Skip to content

Instantly share code, notes, and snippets.

@jbking
jbking / setup_virtualenv.sh
Created October 28, 2011 11:27
Setup a virtalenv for Google Appengine.
#!/bin/sh # -x
function usage {
echo "Usage: $0 python_path virtualenv_path"
echo "Setup a virtalenv for Google Appengine."
echo ""
echo "python_path Path to the Python interpreter used to the virtualenv."
echo "virtualenv_path Path to the target virtualenv."
exit
}
nnoremap <expr> / ':<C-u>Unite -start-insert -buffer-name="search-' . buffer_number('%') . '" line<CR>'
nnoremap <expr> * ':<C-u>UniteWithCursorWord -buffer-name="search-' . buffer_number('%') . '" line<CR>'
nnoremap <expr> n ':<C-u>UniteResume -no-start-insert -buffer-name="search-' . buffer_number('%') . '"<CR>'
@jbking
jbking / gist:998517
Created May 30, 2011 06:28
Generate simple year month list
# -*- coding:utf-8 -*-
from datetime import date
class YearMonth(object):
""" List year/month from specified to today """
def __init__(self, year, month, format='%Y/%m'):
self.year = year
self.month = month
self.format = format
@jbking
jbking / subprocess-example.py
Created March 9, 2011 13:47
wait external process started before testing and kill before exit in teardown in testing cycle.
import os
import time
import socket
import xmlrpclib
import subprocess
here = os.path.dirname(os.path.abspath(__file__))
target = os.path.join(here, 'server.py')
gateway = None
@jbking
jbking / tiny virtualenvwrapper vim plug-in
Created February 1, 2011 10:16
add your virtualenv's site-packages to vim python. then you can use vim python with modules of the site-packages.
function! Workon(name)
" Get virtualenv's site-packages directory.
let b:virtualenv_sitepackages_dir = system('workon ' . a:name . '; cdsitepackages; echo -n $PWD')
python << EOM
import vim
import sys
virtualenv_sitepackages_dir = vim.eval('b:virtualenv_sitepackages_dir')
if virtualenv_sitepackages_dir not in sys.path:
diff -r 66c307b0b7f9 docs/source/erlang_in_practice.rst
--- a/docs/source/erlang_in_practice.rst Tue Dec 01 01:41:06 2009 +0900
+++ b/docs/source/erlang_in_practice.rst Wed May 12 14:54:24 2010 +0900
@@ -22,7 +22,7 @@
- loop から始まるプロセスを常時起動しているコードを書く
- loop を拡張していき、なんかしらのアプリを書いてみる
-上記3つについて具体的にどのような内容で勉強をす滑るべきなのかを解説していきます。
+上記3つについて具体的にどのような内容で勉強をするべきなのかを解説していきます。
diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j
index fc82ea3..86b1f58 100644
--- a/AppKit/CPWindow/CPWindow.j
+++ b/AppKit/CPWindow/CPWindow.j
@@ -176,6 +176,7 @@ CPWindowWillCloseNotification = @"CPWindowWillCloseNotification";
CPWindowDidBecomeMainNotification = @"CPWindowDidBecomeMainNotification";
CPWindowDidResignMainNotification = @"CPWindowDidResignMainNotification";
CPWindowDidMoveNotification = @"CPWindowDidMoveNotification";
+CPWindowDidResizeNotification = @"CPWindowDidResizeNotification";
CPWindowWillBeginSheetNotification = @"CPWindowWillBeginSheetNotification";
@jbking
jbking / using-azerty?.el
Created June 9, 2009 04:57 — forked from anonymous/gist:126269
the function how to get a keyboard layout
(defun using-azerty? ()
(condition-case nil
(let ((buffer (get-buffer-create "*using-azerty?*"))
return)
(set-buffer buffer)
(erase-buffer)
(call-process-shell-command "setxkbmap" nil buffer nil "-print")
(goto-char (point-min))
(setq return (search-forward "azerty" nil t))
(kill-buffer buffer)