View nginx.conf
1 2 3 4 5 6 7 8 9 10
error_log logs/error.log error;
http {
access_log logs/access.log combined;
 
server {
listen 8081;
root /tmp/;
}
server {
listen 8080;
View inheritance.py
1 2 3 4 5 6 7 8 9 10
$ python inheritance.py
At SuperClass.echo: SuperClass
----------
Before calling super at AClass.echo: AClass
At SuperClass.echo: AClass
After calling super at AClass.echo: AClass
----------
Before calling super at BClass.echo: BClass
At SuperClass.echo: BClass
After calling super at BClass.echo: BClass
View DropboxSync.py
1 2 3 4 5 6 7 8 9
import shutil
import os
import sys
import pickle
from dropbox.rest import ErrorResponse
 
 
STATE_FILE = '.dropbox_state'
REMOTE_ROOT_PATH = '/Apps/my-pythonista-app' # sync root in dropbox where code is
View Counter.py
1 2 3 4 5 6 7 8 9 10
# coding: utf-8
 
import ui
 
v = ui.load_view('Untitled')
 
i = 0
lbl = v['label1']
def btn_action(sender):
global i
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>'
Something went wrong with that request. Please try again.