Skip to content

Instantly share code, notes, and snippets.

View sardaukar's full-sized avatar
:shipit:
Always be shipping

Bruno Antunes sardaukar

:shipit:
Always be shipping
View GitHub Profile
@sardaukar
sardaukar / desktop_changer.rb
Created May 24, 2019 06:45
GNOME desktop picture changer
#!/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
@sardaukar
sardaukar / .envrc
Created June 26, 2018 17:01
.envrc multi-env
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"
@sardaukar
sardaukar / Udongein.html
Created April 21, 2018 12:01 — forked from jaysn/Udongein.html
Reisen Udongein html table
<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>
@sardaukar
sardaukar / fizz_buzz.exs
Created May 4, 2017 09:23 — forked from gonzofish/fizz_buzz.exs
Solving FizzBuzz without if in Elixir
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
@sardaukar
sardaukar / flac2mp3.fish
Created April 10, 2017 21:38
flac2mp3 (fish shell)
#!/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

@sardaukar
sardaukar / keybase.md
Created July 23, 2014 16:09
keybase.md

Keybase proof

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:

#!/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 &