Skip to content

Instantly share code, notes, and snippets.

@jbrechtel
jbrechtel / timezones
Last active September 17, 2018 14:21
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
#!/bin/sh
#pacmd set-default-sink alsa_output.usb-Logitech_Logitech_G933_Gaming_Wireless_Headset-00.analog-stereo
#pacmd set-default-source alsa_input.usb-Logitech_Logitech_G933_Gaming_Wireless_Headset-00.analog-mono
function switchAudio() {
case "$1" in
"logitech")
local sink="alsa_output.usb-Logitech_Logitech_G933_Gaming_Wireless_Headset-00.analog-stereo"
@jbrechtel
jbrechtel / subscription_by_queue_arn.sh
Last active April 22, 2022 10:58
goaws SNS -> SQS subscription
#!/bin/sh
echo "CREATING SUBSCRIPTION WITH QUEUE ARN"
set -e
ENDPOINT_URL="http://localhost:4100"
export AWS_DEFAULT_REGION="us-east-1"
export AWS_SECRET_ACCESS_KEY="fakefakefake"
export AWS_ACCESS_KEY_ID="faketyfakefake"
TOPIC_ARN=$(aws --endpoint-url $ENDPOINT_URL sns create-topic --name test-topic | jq -r ".TopicArn")
/* utilities */
.pull-left {
float: left;
}
.sr-only {
position: absolute !important;
clip: rect(1px, 1px, 1px, 1px);
padding: 0 !important;
border: 0 !important;
@jbrechtel
jbrechtel / bikepacking.org
Last active June 28, 2017 18:44
Bikepacking List

Considerations

  • Volume is worse than weight
  • Eat before you’re hungry

Necessary

  • Food (things you can consume quickly and on the bike)
  • Water (more than 2 water bottles. A camelback in a framebag works well here)
  • Shelter with rain fly
@jbrechtel
jbrechtel / uri_join_sucks.rb
Created May 24, 2017 20:27
Why Ruby's URI join sucks.
require 'uri'
base = 'http://google.com'
foo = 'foo'
bar = 'bar'
puts URI::join(base, foo)
puts URI::join(base, foo, bar)
@jbrechtel
jbrechtel / does_compile.ts
Created April 28, 2016 18:19
Typescript Structural Typing
class Thing implements IThing {
constructor(private name: string) { }
public doStuff(): string {
return "hello";
}
}
interface IThing {
doStuff(): string
quine.rb:1: syntax error, unexpected tINTEGER, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
quine.rb:1: syntax error, unexpected tI...
^
[0, -30, 30, 0, -30, 30, 0, -30, 30, 0]
[0, -30, 30, 0, -30, 30, 0, -30, 30, 0]
[0, -30, 30, 0, -30, 30, 0, -30, 30, 0]
user system total real
eager_map 0.400000 0.010000 0.410000 ( 0.413597)
lazy_map 1.640000 0.000000 1.640000 ( 1.642215)
composed 0.610000 0.000000 0.610000 ( 0.610857)
m_composed 0.140000 0.000000 0.140000 ( 0.136136)