copy .todo.cfg for todo.txt
after brew install todo.txt
cp /usr/local/Cellar/todo-txt/2.8/todo.cfg ~/.todo.cfg
opendiff for Xcode 4.3.2
另一個建立於 Requests 上的 HTTP command line 套件,看起來很方便。
Although cURL is great, we’re always looking for great console tools for working with HTTP. Jakub Roztocil has released HTTPie. Built on Requests, HTTPie provides a clean command line interface for HTTP requests:
http PATCH api.example.com/person/1 X-API-Token:123 name=John email=john@example.org PATCH /person/1 HTTP/1.1 User-Agent: HTTPie/0.1 X-API-Token: 123 Content-Type: application/json; charset=utf-8 {"name": "John", "email": "john@example.org"}I appreciate the colored terminal output:
Source on GitHub.
FileMerge of Xcode 4.3
No FileMerge found on Xcode 4.3?
Error: No developer directory found at /Developer. Run /usr/bin/xcode-select to update the developer directory path.
% sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
From: https://groups.google.com/forum/?fromgroups#!topic/versions/LrN7VrVVA34
Using perfarce with Mercurial 1.9
If you’re in the kind of situation of using perfarce with Perforce, after upgrade to Mercurial 1.9, you may need the patch at this moment(perfarce changeset c05711ba688f):
diff -r c05711ba688f perfarce.py
--- a/perfarce.py Fri Apr 15 14:22:16 2011 +0100
+++ b/perfarce.py Wed Jul 06 11:04:34 2011 +0800
@@ -77,17 +77,17 @@ Five built-in commands are overridden:
the p4 depot. Directory and filename case is preserved.
These two setting are workarounds to handle Perforce depots
containing a path spelled differently from file to file
(e.g. path/foo and PAth/bar are in the same directory),
or where the same file may be spelled differently from time
to time (e.g. path/foo and path/FOO are the same object).
'''
-from mercurial import cmdutil, commands, context, copies, encoding, error, extensions, hg, node, repo, util, url
+from mercurial import cmdutil, commands, context, copies, encoding, error, extensions, hg, node, repo, util, scmutil, url
from mercurial.node import hex, short
from mercurial.i18n import _
import marshal, tempfile, os, re, string
def uisetup(ui):
'''monkeypatch pull and push for p4:// support'''
@@ -1279,27 +1279,27 @@ def push(original, ui, repo, dest=None,
try:
# now add/edit/delete the files
if mod:
modal(_('opening for edit: %s\n'), 'edit -c %s' % use, mod, client.encodename)
if mod or add:
ui.note(_('retrieving file contents...\n'))
- opener = util.opener(client.rootpart)
+ opener = scmutil.opener(client.rootpart)
for name, mode in mod + add:
ui.debug(_('writing: %s\n') % name)
if 'l' in mode:
opener.symlink(ctx[name].data(), name)
else:
fp = opener(name, mode="w")
fp.write(ctx[name].data())
fp.close()
- util.set_flags(client.localpath(name), 'l' in mode, 'x' in mode)
+ util.setflags(client.localpath(name), 'l' in mode, 'x' in mode)
if add:
modal(_('opening for add: %s\n'), 'add -f -c %s' % use, add, lambda n:n)
if ntg:
ui.note(_('opening for integrate: %s\n') % ' '.join(f[1] for f in ntg))
for f in ntg:
client.runs('integrate -c %s %s %s' % (use, f[0], f[1]))
build Psycopg2 failed on Windows
每個時代都在遇到的問題:套件TMD裝不起來。
就腳本語言(script language)來說,套件在 Windows 上的問題還滿嚴重的。
pip install Psycopg2
.\psycopg/lobject.h(29) : fatal error C1083: Cannot open include file: ‘libpq/li
bpq-fs.h’: No such file or directory
這時可以指定 pc_config.exe 這樣自己來 build 看看(參考):
cd build\Psycopg2
python setup.py build_ext —pg-config=C:\path\to\pg_config.exe build
build 成功的話可以 pip install Psycopg2 了
如果在安裝時若出現 “mt.exe” not found…
則需要把 xxx 版的 Windows SDK 加入環境變數的路徑(Path)
例:C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin
有點髒的解法,給混沌的世界。

