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
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
""" | |
Python Singleton with parameters (so the same parameters get you the same object) | |
with support to default arguments and passing arguments as kwargs (but no support for pure kwargs). | |
And implementation for MongoClient class from pymongo package. | |
""" | |
from pymongo import MongoClient | |
import inspect | |
#!/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: |
# Intent: interface to the GodotPayments module (remember to add the java path in the project settings android>modules ) | |
"Intent.gd" | |
extends Node | |
# Interface for the GodotPayments module | |
# To use extend this script and save the result on the Global singleton 'Data' | |
const STATIC_RESPONSE_NONE = 0 | |
const STATIC_RESPONSE_ALL = 1 |
#!/usr/bin/env python | |
import tkinter as tk | |
import math | |
import re | |
from collections import ChainMap | |
Nrows = 5 | |
Ncols = 5 |
var counter = 0; | |
var i = setInterval(function() { | |
window.InputEvent = window.Event || window.InputEvent; | |
var d = new Date(); | |
var event = new InputEvent('input', { | |
bubbles: true | |
}); | |
var textbox = document.querySelector('#main > footer > div.block-compose > div.input-container > div.pluggable-input.pluggable-input-compose > div.pluggable-input-body.copyable-text.selectable-text'); | |
var textToSend = "Me responde!"; |
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'} |
#!/usr/bin/env python | |
""" | |
Convert camel-case to snake-case in python. | |
e.g.: CamelCase -> snake_case | |
Relevant StackOverflow question: http://stackoverflow.com/a/1176023/293064 | |
""" |
/* | |
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(); |