Skip to content

Instantly share code, notes, and snippets.

Christmas List

Video Games

  • 3DS XL Charging Cradle - available here
  • PS Vita 32 Gb Memory Card
  • LEGO Marvel Super Heroes Xbox 360

Blu Rays

  • Wreck It Ralph
  • Game of Thrones Season 1 and 2
  • Dark Knight Rises
@DVG
DVG / bradley_page_object.rb
Created December 13, 2013 16:32
Super simple page object pattern
require 'capybara'
require 'capybara/dsl'
include Capybara::DSL
Capybara.default_driver = :selenium
Capybara.run_server = false
# Keep selenium happy behind the proxy
ENV['no_proxy'] = "127.0.0.1"
ENV['NO_PROXY'] = "127.0.0.1"
@DVG
DVG / classy_delete_widget.coffee
Last active January 3, 2016 08:49
Delete Widget
class App.FancyDelete extends App.Object
constructor: (@_destroy_url, @_deleteSelector = '.js-delete', @_cancelSelector = '.js-cancel', @_deleteFilter = null, @_cancelFilter = null, @_container = "tr") ->
events = [new App.Event(@_deleteSelector, "click", @destroy, @_deleteFilter),
new App.Event(@_cancelSelector, "click", @cancel, @_cancelFilter)]
super(events)
destroy: (e) =>
e.preventDefault()
self = e.target
if self.find(".js-text").text() == "Delete"
@DVG
DVG / ppa-behind-proxy.bash
Created April 3, 2014 14:38
ppa-behind-proxy.bash
# The ppa will have the sources listed on it's site: https://launchpad.net/~gwendal-lebihan-dev/+archive/cinnamon-stable
# edit /etc/apt/sources.list
deb http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu quantal main
deb-src http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu quantal main
# Add signing key
wget "http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0xA777609328949509" -O out && sudo apt-key add out && rm out
@DVG
DVG / Rakefile
Created September 29, 2014 19:33
Update background Image to National Geographic Photo of the day
TODAY = Time.now.strftime("%Y-%m-%d")
USER = "MY_USER"
PICTURES_DIR = "/home/#{USER}/Pictures/national-geographic/"
TODAYS_PICTURE = "#{PICTURES_DIR}#{TODAY}-ngeo.jpg"
PROXY_HOST = 'proxy.example.net'
PROXY_PORT = 8443
desc "Fetch National Geographic Photo of the Day"
task :get_photo_of_the_day do
# http://photography.nationalgeographic.com/photography/photo-of-the-day/
@DVG
DVG / env
Created February 26, 2015 14:37
Environment Variables
COLORTERM=gnome-terminal
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-6qbTLpVXel,guid=65fcd2c788d00cd94308487600000093
DEFAULTS_PATH=/usr/share/gconf/gnome-fallback.default.path
DEFAULT_USER=me
DESKTOP_SESSION=gnome-fallback
DISPLAY=:0.0
EDITOR=vim
FTP_PROXY=http://ftp://proxy.mycompany.net:8000/
GDMSESSION=gnome-fallback
GDM_LANG=en_US
@DVG
DVG / unciorn.rb
Last active August 29, 2015 14:17
Unicorn configuraiton
# set path to app that will be used to configure unicorn,
# note the trailing slash in this example
@dir = "/path/to/app/"
worker_processes 2
working_directory @dir
timeout 30
# Specify path to socket unicorn listens to,
@DVG
DVG / nginx.conf
Created March 18, 2015 14:18
nginx for sinatra
# this sets the user nginx will run as,
#and the number of worker processes
user nobody nogroup;
worker_processes 1;
# setup where nginx will log errors to
# and where the nginx process id resides
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
@DVG
DVG / Dockerfile
Created April 11, 2015 19:14
Docker
FROM ruby:2.2.1
RUN apt-get update -qq && apt-get install -y build-essential
RUN apt-get install -y libxml2-dev libxslt1-dev
RUN apt-get install -y libqt4-webkit libqt4-dev xvfb
RUN apt-get install -y nodejs
ENV APP_HOME /code
RUN mkdir $APP_HOME
WORKDIR $APP_HOME
ADD Gemfile* $APP_HOME/
@DVG
DVG / patch-chrome.sh
Created May 26, 2015 13:22
Patch Chrome
#!/bin/bash
cp /usr/share/applications/google-chrome.desktop ~/google-chrome.desktop.bak~
sudo sed -i 's/\/usr\/bin\/google\-chrome\-stable/\/usr\/bin\/google\-chrome\-stable \-\-touch\-devices=123/g' /usr/share/applications/google-chrome.desktop