Skip to content

Instantly share code, notes, and snippets.

View chat spaces
chat spaces I use regularly
Signal
Instagram
Slack
Mastodon
SMS/RCS
iMessage
Keybase
View for onename
Verifying that +ra is my blockchain ID. https://onename.com/ra
@ra
ra / keybase.md
Last active Dec 5, 2015
Keybase proof
View keybase.md

Keybase proof

I hereby claim:

  • I am ra on github.
  • I am allard (https://keybase.io/allard) on keybase.
  • I have a public key ASAIR7ILTRpEfyjpYOjf7crGmN-IIhdHyL7aWcfsaQqNlQo

To claim this, I am signing this object:

@ra
ra / f.go
Created Dec 5, 2013
print runes over for loop range of Unicode code points
View f.go
package main
import (
"fmt"
)
func main() {
// x := string([]rune{0x767d, 0x9d6c, 0x7fd4}) // works
// x := string(rune(0x66)) // works
@ra
ra / two cases — two minutes old, and not there
Created Jul 8, 2013
The Citi Bike JSON endpoint can be late or disappear altogether. Generally it's about 60 or 120 seconds late. (That's assuming you're sampling on the minute too.) That is, its executionTime is that much behind the actual time. Sometimes this increases.
View two cases — two minutes old, and not there
$ for i in {1..10}; do sleep 4; date; curl -s http://citibikenyc.com/stations/json | tr "},{" " \n" | head -2 | tail -1; done
Mon Jul 8 17:38:20 UTC 2013
"executionTime":"2013-07-08 01:36:01 PM" "stationBeanList":[
Mon Jul 8 17:38:24 UTC 2013
"executionTime":"2013-07-08 01:36:01 PM" "stationBeanList":[
Mon Jul 8 17:38:28 UTC 2013
"executionTime":"2013-07-08 01:38:01 PM" "stationBeanList":[
Mon Jul 8 17:38:33 UTC 2013
"executionTime":"2013-07-08 01:38:01 PM" "stationBeanList":[
Mon Jul 8 17:38:37 UTC 2013
@ra
ra / gist:5801028
Created Jun 17, 2013
total bikes in, and also count of stations with 0 bikes. grab is from github.com/ra/leftern
View gist:5801028
cut -d : -f 10 grab | cut -d ' ' -f 1 | awk '{total = total + $1}END{print total}'
grep -v Planned grab | cut -d : -f 10 | cut -d ' ' -f 1 | grep -c ^0$
@ra
ra / .muttrc
Created Jun 1, 2012
Gmail .muttrc
View .muttrc
# login information
set imap_user='account@gmail.com'
set imap_pass='password'
# email server location
set spoolfile=imaps://account@gmail.com@imap.gmail.com:993/INBOX
set folder=imaps://account@gmail.com@imap.gmail.com:993/
set smtp_url=smtp://account@gmail.com:password@smtp.gmail.com:587
set editor=/usr/bin/vi
set from=account@gmail.com
@ra
ra / gist:1394521
Created Nov 25, 2011
crosh commands, limited shell on Acer Chromebook
View gist:1394521
crosh> help
enterprise_ca_approve [--allow-self-signed] <url>
Approve an enterprise certificate authority. The <url> option should be
an http or https url to your enterprise Certificate Authority in PEM
format. This CA will be used to validate the signature of an enterprise
policy extension.
If the --allow-self-signed option is provided, then you may provide a self
signed CA. Use this only if you are certain of the source of the CA.
@ra
ra / gist:894523
Created Mar 30, 2011
crosh commands, limited shell on Cr-48
View gist:894523
crosh> help
enterprise_ca_approve [--allow-self-signed] <url>
Approve an enterprise certificate authority. The <url> option should be
an http or https url to your enterprise Certificate Authority in PEM
format. This CA will be used to validate the signature of an enterprise
policy extension.
If the --allow-self-signed option is provided, then you may provide a self
signed CA. Use this only if you are certain of the source of the CA.
@ra
ra / gist:709404
Created Nov 22, 2010
count mentions in usesthis.com
View gist:709404
for i in gmail emacs twitter; do curl -s -A Safari http://www.google.com/search?q=site:usesthis.com+$i | fmt | grep About | grep results ; done