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
fn main() { | |
let args = os::args(); | |
let mut washed_args = Vec::new(); | |
for arg in args.iter() { | |
washed_args.push(arg.as_slice()) | |
} | |
match washed_args.as_slice() { | |
[_, "review", opts..] => { review(opts) } | |
_ => { usage() } |
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 collections import defaultdict | |
__all__ = 'group_by', 'index_by' | |
def group_by(iterable, key): | |
grouped = defaultdict(list) | |
for item in iterable: | |
grouped[key(item)].append(item) | |
return grouped |
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
def make_adder(): | |
grand_total = 0 | |
def adder(to_add): | |
nonlocal grand_total | |
print("Grand total moved from: %s" % grand_total) | |
grand_total += to_add | |
print("To: %s \n" % grand_total) | |
return grand_total | |
return adder | |
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
window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL; | |
window.saveAs = window.saveAs || window.webkitSaveAs || window.mozSaveAs || window.msSaveAs; | |
function saveCanvas (canvas, filename, fileformat) { | |
if (navigator.msSaveBlob || window.URL || window.saveAs) { | |
if (canvas.toBlob) { | |
canvas.toBlob(function (blob) { | |
saveBlob(blob, filename); | |
}, fileformat); | |
} |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <linux/input.h> | |
#include <sys/types.h> | |
#include <fcntl.h> | |
int main (int argc, char *argv[]) { | |
struct input_event ev; |
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
@-moz-document domain("twitter.com"), domain("tweetdeck.twitter.com") { | |
.hearty .prf .lst-profile .icon-favorite:before, | |
.hearty .tweet-action .icon-favorite:before, | |
.hearty .tweet-detail-action .icon-favorite:before { | |
-webkit-filter: grayscale(1) brightness(2.4); | |
filter: grayscale(1) brightness(2.4); | |
} | |
.hearty .prf .lst-profile a:hover .icon-favorite:before, | |
.hearty .prf .lst-profile a:focus .icon-favorite:before, |
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 | |
# | |
# A very simple script to compare two folders, only based on file names (and | |
# not file content). | |
# I'm sure there are lots of programs that do just this but given how short it | |
# is it was faster for me to write this than to search for a tool that does | |
# exactly what I want. | |
from __future__ import print_function |
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 useful in debug mode. For production you want to compile your | |
scripts down to an signle file and an old ECMAScript version. | |
--> | |
<script type="application/javascript;version=1.8"> | |
// Firefox needs application/javascript;version=1.7 or ...;version=1.8 | |
// for new ECMAScript syntax features. It will also include Mozilla-only | |
// syntax extensions, so be careful not to accidentally use those. | |
// However, other browsers don't understand that script type. |
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
// ==UserScript== | |
// @name Auto-scroll in rabb.it chat | |
// @namespace http://panzi.github.io/ | |
// @description Automaticall scroll the chat on rabb.it to the bottom. | |
// @include https://www.rabb.it/* | |
// @include http://www.rabb.it/* | |
// @include https://rabb.it/* | |
// @include http://rabb.it/* | |
// @version 1.0 | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name Auto-scroll in rabb.it chat | |
// @namespace http://panzi.github.io/ | |
// @description Automaticall scroll the chat on rabb.it to the bottom. | |
// @include https://www.rabb.it/* | |
// @include http://www.rabb.it/* | |
// @include https://rabb.it/* | |
// @include http://rabb.it/* | |
// @version 1.0 | |
// ==/UserScript== |