Make a package.json
file if you don't have one yet:
npm init
# just keep pressing enter.
# this will create the file `package.json`
def circle(people, i=0): | |
killer = people[i % len(people)] | |
i = (i + 1) % len(people) | |
killed = people.pop(i) | |
return circle(people, i) if len(people) > 1 else people.pop() | |
print circle(range(1, 101)) |
## THIS IS UNTESTED | |
from worker.models import TaskType | |
from website.celery import app | |
import importlib | |
# Dynamically add registered tasks | |
# Celery._tasks is a task registry object | |
# https://github.com/celery/celery/blob/34c43244b1681a59540936748800aaa504786a35/celery/app/base.py#L162 - _tasks |
var throttle = function(f, cd) { | |
var _cd = new Date; | |
return function() { | |
if (_cd - new Date < 0) { | |
_cd = new Date(new Date().getTime() + cd); | |
return f.apply(this, arguments); | |
} | |
}; | |
}; |
import sys; from PIL import Image; import numpy as np | |
chars = np.asarray(list(' .,:;irsXA253hMHGS#9B&@')) | |
if len(sys.argv) != 4: print( 'Usage: ./asciinator.py image scale factor' ); sys.exit() | |
f, SC, GCF, WCF = sys.argv[1], float(sys.argv[2]), float(sys.argv[3]), 7/4 | |
img = Image.open(f) | |
S = ( round(img.size[0]*SC*WCF), round(img.size[1]*SC) ) | |
img = np.sum( np.asarray( img.resize(S) ), axis=2) |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
#!/usr/bin/env python | |
# Ported to Python from http://www.vim.org/scripts/script.php?script_id=1349 | |
print "Color indexes should be drawn in bold text of the same color." | |
colored = [0] + [0x5f + 40 * n for n in range(0, 5)] | |
colored_palette = [ | |
"%02x/%02x/%02x" % (r, g, b) | |
for r in colored |