Skip to content

Instantly share code, notes, and snippets.

@ra
ra / chat spaces
Last active December 26, 2023 00:11
chat spaces I use regularly
Signal
Mastodon
iMessage/Messages (Apple)
SMS
Instagram
Slack
@ra
ra / .muttrc
Created June 1, 2012 23:31
Gmail .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:894523
Created March 30, 2011 14:42
crosh commands, limited shell on Cr-48
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:1394521
Created November 25, 2011 22:03
crosh commands, limited shell on Acer Chromebook
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 / f.go
Created December 5, 2013 14:27
print runes over for loop range of Unicode code points
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 July 8, 2013 18:07
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.
$ 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 June 17, 2013 22:21
total bikes in, and also count of stations with 0 bikes. grab is from github.com/ra/leftern
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 / keybase.md
Last active December 5, 2015 16:25
Keybase proof

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:

Verifying that +ra is my blockchain ID. https://onename.com/ra
@ra
ra / gist:709404
Created November 22, 2010 01:44
count mentions in usesthis.com
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