Skip to content

Instantly share code, notes, and snippets.

@ldenman
ldenman / gist:1612034
Created January 14, 2012 16:58
Record battery life
#!/bin/sh
printf "time\t\tpercent\n"
while :
do
PERCENT=`acpitool -B | grep "Remaining" | sed 's/,//g' | awk '{ print $5 }'`
TIME=`date +%s`
printf "%s\t%s\n" $TIME $PERCENT
sleep 1
@ldenman
ldenman / quicken-audio-books
Created February 3, 2012 06:45
I like to listen to audio books efficiently.
mplayer -af scaletempo=scale=1.5:speed=pitch Some/Audio/Book/*.mp3
@ldenman
ldenman / wait_until.rb
Created March 8, 2012 20:59 — forked from metaskills/wait_until.rb
Never sleep() using Capybara!
# Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations?
describe 'Modal' do
should 'display login errors' do
visit root_path
click_link 'My HomeMarks'
within '#login_area' do
fill_in 'email', with: 'will@not.work'
fill_in 'password', with: 'test'
#!/bin/sh
root=$(pwd)
prefix="$root/vendor/tidy"
# build into $prefix
/bin/sh build/gnuauto/setup.sh
./configure --prefix="${prefix}"
make
make DESTDIR=$prefix install
domain: relevance # eg, flamethrower.campfirenow.com
token: *****
ascii_conversion:
enabled: false
#!/bin/bash
# /etc/init.d/xvfb_daemon
# Xvfb startup script.
# Tom Meier <tom@venombytes.com>
#
### BEGIN INIT INFO
# Provides: xvfb
# Short-Description: Start/stop/restart daemon
# Description: Controls the Xvfb daemon which starts/stops the X Virtual Framebuffer server
### END INIT INFO
package aws
import (
"fmt"
"log"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/cognitoidentityprovider"