Skip to content

Instantly share code, notes, and snippets.

View timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
View switchaudio.sh
#!/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 Apr 22, 2022
goaws SNS -> SQS subscription
View subscription_by_queue_arn.sh
#!/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")
View px-video.css
/* 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 Jun 28, 2017
Bikepacking List
View bikepacking.org

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
Why Ruby's URI join sucks.
View uri_join_sucks.rb
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 Apr 28, 2016
Typescript Structural Typing
View does_compile.ts
class Thing implements IThing {
constructor(private name: string) { }
public doStuff(): string {
return "hello";
}
}
interface IThing {
doStuff(): string
View quine.rb
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...
^
View benchmark_results
[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)