Skip to content

Instantly share code, notes, and snippets.

View dwradcliffe's full-sized avatar

David Radcliffe dwradcliffe

View GitHub Profile
@dwradcliffe
dwradcliffe / Vagrantfile
Last active August 29, 2015 13:56
RepoForge build environment setup for Vagrant
Vagrant.configure("2") do |config|
config.vm.box = "opscode_centos-6.4_chef-provisionerless"
config.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.4_chef-provisionerless.box"
config.vm.provision "shell",
path: 'https://gist.githubusercontent.com/dwradcliffe/9329745/raw/7b4860e8b253d510dc6e3bd6b075c179b9f92156/gistfile1.sh'
end

Keybase proof

I hereby claim:

  • I am dwradcliffe on github.
  • I am dwradcliffe (https://keybase.io/dwradcliffe) on keybase.
  • I have a public key whose fingerprint is 7DA4 5F36 4145 8746 93E4 E73C 330F 18D7 51B6 5B7A

To claim this, I am signing this object:

@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)
require File.dirname(__FILE__) + '/config/environment'
run ActionController::Dispatcher.new
@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 / _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 / 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 / myview.js.coffee
Created March 13, 2012 17:04 — forked from NickJosevski/myview.js.coffee
backbone example - serialize form + update on change
window.MyView = Backbone.View.extend({
initialize: ->
_.bindAll(this,'render')
this.template = window.JST["MyView"]
this.model.bind('change', this.render)
render: ->
$(this.el).html(this.template(this.model.toJSON()))
events: {
class Player < ActiveRecord::Base
def salary_valid_for_year? year
send("s#{year}") != 0 && send("status#{year}") != 0 && !send("status#{year}").nil?
end
def salary_for_year year
send("s#{year}")
end
{
"id": "rubygems",
"application": {
"production": {
"rails_postgresql_host" : "",
"rails_postgresql_db": "",
"rails_postgresql_user": "",
"rails_postgresql_password": "",
"s3_key": "",
"s3_secret": "",