Skip to content

Instantly share code, notes, and snippets.

View dwradcliffe's full-sized avatar

David Radcliffe dwradcliffe

View GitHub Profile
@dwradcliffe
dwradcliffe / apcurl.sh
Created February 17, 2012 20:54
Quick shell script to print json nicely from curl
#!/bin/bash
curl -# $* | ruby -e "require 'rubygems';require 'json';require 'awesome_print'; ap JSON.parse(STDIN.gets)"
@dwradcliffe
dwradcliffe / _instructions.txt
Created January 18, 2012 15:17
Using quitgodaddy.com with 1&1
Noah Coffey (@noahwesley) built a great little tool (http://quitgodaddy.com) to help people
move their domains off GoDaddy by reminding them before the expiration dates.
I have a whole bunch of domains on 1&1 (another horrible company) and wanted to use Noah's tool.
He was kind enough to provide the proper format and I wrote a quick script to pull all my domains
off the 1&1 admin page.
How to use:
Navigate to your domains page. Select 100 domains on a page. You'll have to do the following
@dwradcliffe
dwradcliffe / bootstrap.sh
Created July 27, 2011 17:20
Chef bootstrap
#!/bin/bash
apt-get install ssh build-essential
wget http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise_1.8.7-2011.03_i386_ubuntu10.04.deb
dpkg -i ruby-enterprise_1.8.7-2011.03_i386_ubuntu10.04.deb
gem install chef --no-ri --no-rdoc
@dwradcliffe
dwradcliffe / index.html
Created June 20, 2011 12:50
Google Maps Quckstart
<!DOCTYPE html>
<html>
<head>
<title>Google Maps Quickstart</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>
require File.dirname(__FILE__) + '/config/environment'
run ActionController::Dispatcher.new
@dwradcliffe
dwradcliffe / generate_anonymous_users.rb
Created February 9, 2011 15:40
spree migration fix
class GenerateAnonymousUsers < ActiveRecord::Migration
def self.up
User.reset_column_information
puts Order.where(:user_id => nil).where(:state != "balance_due").count.to_s + " remaining..."
Order.where(:user_id => nil).where(:state != "balance_due").each do |order|
user = User.anonymous!
user.email ||= order.email
puts user.login
user.save!
order.update_attribute_without_callbacks("user_id", user.id)