Mix.install([
{:regulator, "~> 0.6.0"},
{:kino, "~> 0.14.2"},
{:kino_vega_lite, "~> 0.1.9"},
{:vega_lite, "~> 0.1.11"}
])
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env ruby | |
DIR = "/home/sardaukar/Pictures/Homeworld" | |
SLEEP_IN_SECONDS = 300 | |
trap("INT") { exit 0 } | |
loop do | |
file = Dir.entries(DIR).select {|d| d.index("jpg")}.sample |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context= | |
[[ -f .envrc.context ]] && context=$(< .envrc.context) | |
watch_file ".envrc.context" | |
RED='\033[0;31m' | |
LBLUE='\033[1;34m' | |
NC='\033[0m' | |
if [[ -n "$context" ]]; then | |
context_file=".envrc.$context" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body bgcolor=000000> | |
<table boder=0 cellpadding=0 cellspacing=0> | |
<tr height=3> | |
<td width=3 bgcolor=888888 rowspan=105></td> | |
<td bgcolor=888888 colspan=54></td> | |
<td width=3 bgcolor=888888 rowspan=105></td> | |
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fizz_word = fn | |
(0, 0, _) -> "FizzBuzz" | |
(0, _, _) -> "Fizz" | |
(_, 0, _) -> "Buzz" | |
(_, _, third) -> third | |
end | |
fizz_buzz = fn n -> fizz_word.(rem(n, 3), rem(n, 5), n) end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/fish | |
for file in *.flac | |
ffmpeg -i $file -ab 320k -map_metadata 0 -id3v2_version 3 (basename $file .flac).mp3 | |
end |
I have spent quite a bit of time figuring out automounts of NFS shares in OS X...
Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:
/etc/auto_master (see last line):
#
# Automounter master map
#
+auto_master # Use directory service
I hereby claim:
- I am sardaukar on github.
- I am sardaukar (https://keybase.io/sardaukar) on keybase.
- I have a public key whose fingerprint is 7AB6 C47E 0B86 7ECA 0229 F856 A8C4 1D3D A028 94E4
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# ~/.osx — http://mths.be/osx | |
# Ask for the administrator password upfront | |
sudo -v | |
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished | |
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & |