Skip to content

Instantly share code, notes, and snippets.

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"
#!/bin/bash
# /etc/init.d/xvfb_daemon
# Xvfb startup script.
# Tom Meier <[email protected]>
#
### 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
domain: relevance # eg, flamethrower.campfirenow.com
token: *****
ascii_conversion:
enabled: false
#!/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
@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: '[email protected]'
fill_in 'password', with: 'test'
@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 / 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
ubuntu@ubuntu-VirtualBox:~/src/kidsruby$ ruby1.9.1 main.rb
/var/lib/gems/1.9.1/gems/qtbindings-4.6.3.4/lib/Qt/qtruby4.rb:501: [BUG] Segmentation fault
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
-- control frame ----------
c:0018 p:---- s:0053 b:0053 l:000052 d:000052 CFUNC :constData
c:0017 p:0011 s:0050 b:0050 l:000049 d:000049 METHOD /var/lib/gems/1.9.1/gems/qtbindings-4.6.3.4/lib/Qt/qtruby4.rb:501
c:0016 p:0064 s:0047 b:0047 l:000038 d:000046 BLOCK /var/lib/gems/1.9.1/gems/qtbindings-4.6.3.4/lib/Qt/qtruby4.rb:3069
c:0015 p:---- s:0044 b:0044 l:000043 d:000043 FINISH
c:0014 p:---- s:0042 b:0042 l:000041 d:000041 CFUNC :each
@ldenman
ldenman / gist:1390139
Created November 23, 2011 22:37
SourceVimLocal
function! SourceVimLocal()
if filereadable(".vimlocal")
source .vimlocal
endif
endfunction
call SourceVimLocal()
@ldenman
ldenman / capybara_webkit_debug
Created October 6, 2011 23:07
Inconsistent webkit failure
Background: # features/admin/orders/filters_orders_by_delivery_location.feature:7
Given "John Smith" has an order for delivery at "Harvest Moon" # features/step_definitions/admin/order_steps.rb:1
And "Jane Doe" has an order for delivery at "Green's Garage" # features/step_definitions/admin/order_steps.rb:1
And I am on the admin orders page # features/step_definitions/web_steps.rb:44
Scenario: Filtering order by delivery location # features/admin/orders/filters_orders_by_delivery_location.feature:12
When I filter orders by "Harvest Moon" delivery location # features/step_definitions/admin/order_steps.rb:6
Then I should see "John Smith" # features/step_definitions/web_steps.rb:105
And I should not see "Jane Doe" # features/step_definitions/web_steps.rb:123
And the delivery location "Harvest Moon" should be sele