git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
/* | |
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace | |
so it's better encapsulated. Now you can have multiple random number generators | |
and they won't stomp all over eachother's state. | |
If you want to use this as a substitute for Math.random(), use the random() | |
method like so: | |
var m = new MersenneTwister(); |
#include <assert.h> | |
#include <stdarg.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
enum type { | |
NIL, |
#!/usr/bin/env python | |
""" | |
Tail-Recursion helper in Python. | |
Inspired by the trampoline function at | |
http://jasonmbaker.com/tail-recursion-in-python-using-pysistence | |
Tail-recursive functions return calls to tail-recursive functions | |
(themselves, most of the time). For example, this is tail-recursive: |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import urllib2 | |
gh_url = 'https://api.github.com' | |
req = urllib2.Request(gh_url) | |
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() |
class underscore_dict(dict): | |
""" | |
a dict like object that forces key to be pythonic and follow the underscore | |
convention. | |
eg:: | |
>>> d = underscore_dict(dict(myKey='my_value')) | |
>>> print d | |
'my_key': 'my_value'} |
import re | |
from jinja2 import evalcontextfilter, Markup, escape | |
@app.template_filter() | |
@evalcontextfilter | |
def linebreaks(eval_ctx, value): | |
"""Converts newlines into <p> and <br />s.""" | |
value = re.sub(r'\r\n|\r|\n', '\n', value) # normalize newlines | |
paras = re.split('\n{2,}', value) |
node_modules | |
*.swp |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
# SNAKES GAME | |
# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting | |
import curses | |
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN | |
from random import randint | |
curses.initscr() | |
win = curses.newwin(20, 60, 0, 0) |
<html> | |
<head> | |
<title>Untitled Test</title> | |
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-git.css"> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> | |
<script type="text/javascript" src="http://code.jquery.com/qunit/qunit-git.js"></script> | |
<script type="text/javascript" src="tests.js"></script> | |
</head> |