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
oneliner = 'output.writerow(map(lambda x: x[1], filter(lambda x: True if x[0] else False, zip(filter_map,line))))' | |
# First, we zip two lists together, in this case we take something like: | |
# x = [ {}, {}, {'one':1} ] | |
# y = [ [one, one, one], [two, two, two], [three, three, three] ] | |
# and turn it into: | |
# z = [ ({}, [one, one, one]), ({}, [two, two, two]), ({'one':1}, [three, three, three]) ] | |
test_list = zip(filter_map, line) |
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
// to generate the number of days since a date | |
var days = (new Date() - new Date(2014, 7, 11)) / (1000 * 60 * 60 * 24); | |
var days_whole = Math.floor(days); | |
// in order to determine what the date is X days from now (we'll use days_whole) | |
var now = new Date(); | |
var millis_to_date = days_whole * (1000 * 60 * 60 * 24); | |
var next_date = new Date(now.getTime() + millis_to_date); |
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
===> Compiling eredis | |
===> erl_opts [debug_info,{d,namespaced_types}] | |
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace | |
===> Uncaught error: {'EXIT', | |
{function_clause, | |
[{filename,join, | |
[[]], | |
[{file,"filename.erl"},{line,392}]}, | |
{rebar_erlc_compiler,expand_include_lib_path, | |
1, |
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
### Keybase proof | |
I hereby claim: | |
* I am graham on github. | |
* I am grahamabbott (https://keybase.io/grahamabbott) on keybase. | |
* I have a public key whose fingerprint is 0BAA 821A 77E9 E1E5 867A A206 D9C9 DDED 8B57 A99A | |
To claim this, I am signing this object: |
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
{ | |
"version":"2.0", | |
"metadata":{ | |
"apiVersion":"2015-03-31", | |
"endpointPrefix":"apigateway", | |
"serviceFullName":"API Gateway", | |
"signatureVersion":"v4", | |
"protocol":"rest-json" | |
}, | |
"documentation":"", |
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
function ga_code_search() { | |
# alias todo='ga_code_search "TODO\(`whoami`\)"' | |
SCREEN_WIDTH=`stty size | awk '{print $2}'` | |
SCREEN_WIDTH=$((SCREEN_WIDTH-4)) | |
# Given a spooky name so you can alias to whatever you want. | |
# (cs for codesearch) | |
# AG is WAY faster but requires a binary | |
# (try brew install the_silver_searcher) |
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
function ga_code_search() { | |
# alias todo='ga_code_search "TODO\(`whoami`\)"' | |
SCREEN_WIDTH=`stty size | awk '{print $2}'` | |
SCREEN_WIDTH=$((SCREEN_WIDTH-4)) | |
# Given a spooky name so you can alias to whatever you want. | |
# (cs for codesearch) | |
# AG is WAY faster but requires a binary | |
# (try brew install the_silver_searcher) |
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 likely to break, because I'm sure a gmail update will change some of the tags, | |
// but it's helpful if people have special css classes on their emails. | |
function removeChildStyles(dom_element) { | |
dom_element.style = null; | |
for(var index=0; index < dom_element.children.length; index++) { | |
removeChildStyles(dom_element.children[index]); | |
} | |
} |
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
/* | |
Copyright [2014] [Graham Abbott <graham.abbott@gmail.com>] | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
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
//my config file | |
var padding = 4; | |
var pushRight = slate.operation("push", { | |
"direction" : "right", | |
"style" : "bar-resize:screenSizeX/2" | |
}); | |
var pushLeft = slate.operation("push", { |
OlderNewer