Skip to content

Instantly share code, notes, and snippets.

View FAReTek1's full-sized avatar
:shipit:
Guthib is cool

faretek FAReTek1

:shipit:
Guthib is cool
View GitHub Profile
@dakoctba
dakoctba / gist:7676845
Last active February 21, 2025 13:00
How To Reset Your Github Fork

##How To Reset Your Github Fork

Let’s say I want to contribute to a project on github. The project repository is at wp-cli/wp-cli. First I fork it, and then clone the resulting repository, scribu/wp-cli:

git clone --recursive [email protected]:scribu/wp-cli.git
cd wp-cli

Now, I make some commits to master, push them to my fork and open a pull request. Piece of cake:

git commit -m "awesome new feature"

@simonw
simonw / gist:7000493
Created October 15, 2013 23:53
How to use custom Python JSON serializers and deserializers to automatically roundtrip complex types.
import json, datetime
class RoundTripEncoder(json.JSONEncoder):
DATE_FORMAT = "%Y-%m-%d"
TIME_FORMAT = "%H:%M:%S"
def default(self, obj):
if isinstance(obj, datetime.datetime):
return {
"_type": "datetime",
"value": obj.strftime("%s %s" % (