Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
year="`TZ=Pacific/Auckland date +%Y`"
month="`TZ=Pacific/Auckland date +%m`"
day="`TZ=Pacific/Auckland date +%d`"
hour="`TZ=Pacific/Auckland date +%H-%M`"
basepath='/root/b2_sync'
datepath="$year/$month/$day"
path="$basepath/$datepath"
video_file="cam1-$hour-sjdc.mp4"
### Keybase proof
I hereby claim:
* I am jordandcarter on github.
* I am jordandcarter (https://keybase.io/jordandcarter) on keybase.
* I have a public key whose fingerprint is 38FA 8907 4B46 FA2C C0AE 9158 6A7D 4F94 CC47 D232
To claim this, I am signing this object:
# @jordandcarter adapted from http://fweepcode.blogspot.co.nz/2013/03/faster-tdd-with-rspec-vim-and-quickfix.html
# ./spec/support/formatters/vim_formatter.rb
require 'rspec/core/formatters/base_text_formatter'
class VimFormatter < RSpec::Core::Formatters::BaseTextFormatter
def example_failed example
exception = example.execution_result[:exception]
@jordandcarter
jordandcarter / ping_alert_with_sound.rb
Created October 21, 2010 09:02
Ping a host and hear an alarm on your computer when ping fails.
$audio = File.open("/dev/audio", "w+")
def snd char
$audio.print char.chr
end
def evil z
0.step(100, 4.0 / z) { |i|
(i / z).to_i.times { snd 0}
(i / 4).to_i.times { snd 255}