This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""How to do regular expressions in sqlite3 (using python).""" | |
from __future__ import division, absolute_import, print_function, unicode_literals | |
import re | |
import sys | |
import time | |
import datetime | |
import sqlite3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import sys | |
import imp | |
def find_all(modname, paths=None): | |
"""Find all occurrences of a given module on a given list of paths. | |
If no paths are given, sys.path is used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from string import whitespace | |
atom_end = set('()"\'') | set(whitespace) | |
def parse(sexp): | |
stack, i, length = [[]], 0, len(sexp) | |
while i < length: | |
c = sexp[i] | |
print c, stack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is free and unencumbered software released into the public domain | |
# using the wording of the Unlicense. Please refer to <http://unlicense.org/> | |
from __future__ import division, absolute_import, print_function, unicode_literals | |
"""Use the stdlib module `difflib` to do fuzzy matching. | |
This module also has mixin classes to make searching containers easier. | |
It will also use LRU caching when available. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division, absolute_import, print_function | |
# This is free and unencumbered software released into the public domain. | |
# | |
# Anyone is free to copy, modify, publish, use, compile, sell, or | |
# distribute this software, either in source code form or as a compiled | |
# binary, for any purpose, commercial or non-commercial, and by any | |
# means. | |
# | |
# In jurisdictions that recognize copyright laws, the author or authors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Revert a commit and then check it out as a local change. | |
# Useful if you want to revert only some of the changes from a commit. | |
# The working directory and index should already be clean first. | |
git config --global alias.revclean '!f() { git revert -n $@; git reset HEAD . ; git revert --abort; }; f()' | |
# push all references to a given remote, then fetch all updates from all remotes. | |
# This is useful if a remote has more than one push target (like an "all" remote), | |
# since other remotes that are pushed to won't update their references otherwise. | |
git config --global alias.pushfetch '!f() { git push "$1" --all; git fetch --all; }; f' |
NewerOlder