MURAOKA Yusuke jbking

View passing_queue_like_go.py
1 2 3 4 5 6 7 8 9 10
% python passing_queue_like_go.py
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/queues.py", line 266
, in _feed
send(obj)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/queues.py", line 77,
in __getstate__
assert_spawning(self)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/forking.py", line 52
, in assert_spawning
View gist:5010252
1 2 3 4 5 6 7 8 9
In [1]: from sqlalchemy import create_engine
 
In [2]: postgresql_engine = create_engine('postgresql://')
 
In [3]: mysql_engine = create_engine('mysql://')
 
In [4]: from myapp.resources import Event
 
In [5]: from sqlalchemy.schema import CreateTable
View missing_appear.py
1 2 3 4 5 6 7 8 9 10
from __future__ import print_function
import os
import sys
 
import pygit2
import coverage
 
 
def collect_addition(hunk):
result = []
View kill_children_process.py
1 2 3 4 5 6 7 8 9 10
import os
import subprocess
 
 
def kill_children_process(pid, force=False):
pid = int(pid)
for line in subprocess.check_output(
'/bin/ps -eo "ppid pid"',
shell=True).split('\n')[1:]:
line = line.strip()
View setup_virtualenv.sh
1 2 3 4 5 6 7 8 9 10
#!/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
}
View gist:1250157
1 2 3
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>'
View gist:998517
1 2 3 4 5 6 7 8 9 10
# -*- 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
View subprocess-example.py
1 2 3 4 5 6 7 8 9
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
View tiny virtualenvwrapper vim plug-in
1 2 3 4 5 6 7 8 9 10
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:
View gist:398258
1 2 3 4 5 6 7 8 9
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つについて具体的にどのような内容で勉強をするべきなのかを解説していきます。
Something went wrong with that request. Please try again.