This file contains hidden or 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 | |
from multiprocessing import Process | |
def start_process(func): | |
u"""Decorator that turns the function into a subprocess and starts it asynchronously.""" | |
process = Process(target=func) | |
process.start() | |
return process | |
if __name__ == "__main__": | |
@start_process |
This file contains hidden or 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
Vacuum sqlite without running out of disk space: | |
TMPDIR=. sqlite dbfile.sqlite | |
SQLite version 3.7.2 | |
Enter ".help" for instructions | |
Enter SQL statements terminated with a ";" | |
sqlite> vacuum; |
This file contains hidden or 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
<span style="border:1px dotted;display:inline-block;">stuff</span> |
This file contains hidden or 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
[alias] | |
; Lets you run "git git git git git git git init", "git ungit echo 'Hello, world!'", etc. | |
git = !git | |
ungit = ! |
This file contains hidden or 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
[user] | |
; No default user, lest you start a project as the wrong user. | |
; You have to specify your identity per-repository, using init-xxx or setuser-xxx. | |
; @@@@@ TODO: Should actually give an error when trying to commit before specifying an identity. | |
name = "@@@No user configured@@@" | |
email = "@@@No user configured@@@" | |
[alias] | |
;;;;;; init and user control |
This file contains hidden or 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
javascript:(function(){var a=document.getElementsByTagName('img'),i=a.length;while(b=a[--i]){b.setAttribute('src','http://placekitten.com/'+b.width+'/'+b.height);}}());var KICKASSVERSION='2.0';var s = document.createElement('script');s.type='text/javascript';document.body.appendChild(s);s.src='//hi.kickassapp.com/kickass.js';void(0); |
This file contains hidden or 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 python3 | |
from collections import defaultdict | |
infinite_dict = lambda : defaultdict(infinite_dict) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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/python3 | |
# coding: utf8 | |
# Should work in both Python 2 and Python 3 | |
from __future__ import unicode_literals | |
from __future__ import print_function | |
import io | |
def iterable_to_stream(iterable, buffer_size=io.DEFAULT_BUFFER_SIZE): | |
""" |