Skip to content

Instantly share code, notes, and snippets.

curl -O https://raw.githubusercontent.com/hackclub/metrics/master/slack_stats.tsv
awk 'NR==1 { for (i=2;i<=NF;i++) x[i] = $i } NR!=1 {for (i=2;i<=NF;i++) print $1"\t"x[i]"\t"$i}' slack_stats.tsv > slack_stats_unpivoted.tsv
sqlite3 slack_stats.sqlite3 <<EOF
create table slack_stats (user text, date text, count int);
.separator "\t"
.import slack_stats_unpivoted.tsv slack_stats
EOF
$ npm install -g [email protected]
[email protected] node_modules/npm/node_modules/npmlog/node_modules/ansi -> node_modules/npm/node_modules/ansi
- [email protected] node_modules/npm/node_modules/aproba
[email protected] node_modules/npm/node_modules/tar/node_modules/block-stream -> node_modules/npm/node_modules/block-stream
- [email protected] node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map
- [email protected] node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion
- [email protected] node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch
- [email protected] node_modules/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match
- [email protected] node_modules/npm/node_modules/iferr
- [email protected] node_modules/npm/node_modules/lodash._baseindexof
@tlrobinson
tlrobinson / 1.jsx
Last active December 5, 2015 00:47
const App = ({ items }) =>
<List items={items} />
const List = ({ items }) =>
<ul>
{items.map(item =>
<Item key={item.id} item={item} />
)}
</ul>
@tlrobinson
tlrobinson / gist:740cf43605bc0d1fb541
Last active December 3, 2015 21:19
dhh / harryh facebook bet
(date of facebook ipo) + 30 days = June 17, 2012
http://www.wolframalpha.com/input/?i=%28date+of+facebook+ipo%29+%2B+30+days
market capitalization of facebook on June 17, 2012 = $64.24B
http://www.wolframalpha.com/input/?i=market+capitalization+of+facebook+on+June+17%2C+2012
$33B with 5% interest from September 23, 2010 to June 17, 2012 = $35.99B
http://www.wolframalpha.com/input/?i=compound+interest&a=*C.compound+interest-_*Formula.dflt-&a=FSelect_**PresentValueFutureValueContinuousDates-.dflt-&a=*FS-_**PresentValueFutureValueContinuousDates.FV-.*PresentValueFutureValueContinuousDates.PV-.*PresentValueFutureValueContinuousDates.i--&f4=%2433000000000&f=PresentValueFutureValueContinuousDates.PV%5Cu005f%2433000000000&f5=5+%25&f=PresentValueFutureValueContinuousDates.i%5Cu005f5+%25&f6=September+23%2C+2010&f=PresentValueFutureValueContinuousDates.ID_September+23%2C+2010&f7=June+17%2C+2012&f=PresentValueFutureValueContinuousDates.MD_June+17%2C+2012
(($64.24 - $35.99)/ $35.99) * $10,000 = $7,849
@tlrobinson
tlrobinson / redux-devtools-separate-window.js
Last active August 20, 2019 23:54
Put the awesome redux-devtools in it's own window so it doesn't obscure or be obscured by your application
// give it a name so it reuses the same window
var win = window.open(null, "redux-devtools", "menubar=no,location=no,resizable=yes,scrollbars=no,status=no");
// reload in case it's reusing the same window with the old content
win.location.reload();
// wait a little bit for it to reload, then render
setTimeout(function() {
React.render(
<DebugPanel top right bottom left >
@tlrobinson
tlrobinson / test.sh
Last active August 29, 2015 14:25
codec2/freedv pipe test
rec -t raw -r 8000 -s -2 - | \
./src/c2enc 1400 - - | \
./src/c2dec 1400 - - | \
play -t raw -r 8000 -s -2 -
$ docker run --net=none -t -i jpetazzo/dind
/dev/mapper/control: open failed: Operation not permitted
Failure to communicate with kernel device-mapper driver.
Check that device-mapper is available in the kernel.
Command failed
mount: permission denied
Could not make a tmpfs mount. Did you use --privileged?
@tlrobinson
tlrobinson / gist:191e5023cd34666203b6
Created May 27, 2015 00:30
Almost certainly not what I meant...
$ git git push
WARNING: You called a Git command named 'git', which does not exist.
Continuing under the assumption that you meant 'init'
in 0.1 seconds automatically...
Initialized empty Git repository in /Users/tlrobinson/whatever/push/.git/
@tlrobinson
tlrobinson / reactive-example.go
Last active August 29, 2015 14:17
port of tlrobinson/sbp to GoLang
type OnDataCallback func(InPort, func(string))
type ReactiveComponent func(*Process, OnDataCallback)
func AdaptReactiveComponent(component ReactiveComponent) Component {
return func(proc *Process) {
var wg sync.WaitGroup
onData := func(port InPort, callback func(string)) {
wg.Add(1)
$ babel-node examples/matttest.es6
Wed Mar 11 2015 11:47:26 GMT-0700 (PDT): Network([unknown]).Process(sender1) sending: 0
Wed Mar 11 2015 11:47:26 GMT-0700 (PDT): Network([unknown]).Process(sender2) sending: 0
Wed Mar 11 2015 11:47:26 GMT-0700 (PDT): Network([unknown]).Process(sender1) sending: 1
Wed Mar 11 2015 11:47:26 GMT-0700 (PDT): Network([unknown]).Process(sender2) sending: 1
Wed Mar 11 2015 11:47:26 GMT-0700 (PDT): Network([unknown]).Process(sender1) sending: 2
Wed Mar 11 2015 11:47:26 GMT-0700 (PDT): Network([unknown]).Process(sender2) sending: 2
Wed Mar 11 2015 11:47:26 GMT-0700 (PDT): Network([unknown]).Process(sender1) sending: 3
Wed Mar 11 2015 11:47:26 GMT-0700 (PDT): Network([unknown]).Process(sender2) sending: 3
Wed Mar 11 2015 11:47:26 GMT-0700 (PDT): Network([unknown]).Process(sender1) sending: 4