Skip to content

Instantly share code, notes, and snippets.

View perplexes's full-sized avatar

Colin Curtin perplexes

View GitHub Profile
### Keybase proof
I hereby claim:
* I am perplexes on github.
* I am perplexes (https://keybase.io/perplexes) on keybase.
* I have a public key whose fingerprint is E27F 1732 FE53 88CC F03B 3C84 3B74 C3C6 9C50 474E
To claim this, I am signing this object:
@perplexes
perplexes / Procfile
Created March 5, 2015 19:25
Flowdock groups for hubot
web: bin/hubot -a flowdock -n <<<bot name>>> --enable-slash
@perplexes
perplexes / tag_aws_chef.sh
Created October 8, 2015 17:13
Copy AWS tags to Chef
#!/bin/bash
# brew install awscli
# brew install jq
# brew install parallel
aws ec2 describe-tags |\
jq -r '.Tags[] | select(.ResourceType == "instance") | select(.Key != "Name") | "knife tag create \(.ResourceId) \(.Key)=\(.Value)"' |\
parallel "sh -c {}"
Verifying that +perplexes is my blockchain ID. https://onename.com/perplexes
# Based on http://rosettacode.org/wiki/Knapsack_problem/Bounded#Dynamic_programming_solution
# https://en.wikipedia.org/wiki/Knapsack_problem#0.2F1_knapsack_problem
class KnapsackSolver
attr_reader :table, :items, :limit
# items: [{weight: <whole integer weight>, value: <any numeric value to maximize>}]
# limit: <whole integer weight limit>
#
# For money, you can * 100 to optimize to the cent
# but then the runtime increases by x100
# You can also re-normalize based on the bounds/resolution,
$ sassc test.scss
.fun-exists1 {
exists: false;
compact: true; }
.fun-exists2 {
exists: false;
compact: compact(true); }
$ ~/src/reference/sassc/bin/sassc test_chosen.scss
Error: expected a variable name (e.g. $x) or ')' for the parameter list for -owg-url
on line 4 of test_chosen.scss
>> background: -owg-url(//assets0staging.verbacompete.com/assets/chosen-sprit
------------------------^
$ ~/src/reference/sassc/bin/sassc --version
sassc: 3.3.0
libsass: 3.3.2-32-gb2a3
sass2scss: 1.0.5
@perplexes
perplexes / gradient.scss
Last active December 11, 2015 22:54
Parsing bug linear-gradient
.test{ background-image: -ms-linear-gradient(top left, #4D303B48 0%, #4D2C3642 100%);}
@perplexes
perplexes / Chromebits.MD
Last active January 13, 2016 19:19
Chromebits & Librato
@perplexes
perplexes / gist:e994b788d61b92124921
Created January 14, 2016 20:16
Get current elasticache servers from elasticache config server
$ echo "config get cluster" | nc -i1 name.sha.cfg.use1.cache.amazonaws.com 11211 | sed '3q;d' | tr ' ' '\n' | awk -F'|' '{print $1":"$3}'
verba.pysff9.0001.use1.cache.amazonaws.com:11211
verba.pysff9.0002.use1.cache.amazonaws.com:11211