This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.dirname(__FILE__) + '/config/environment' | |
run ActionController::Dispatcher.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -# $* | ruby -e "require 'rubygems';require 'json';require 'awesome_print'; ap JSON.parse(STDIN.gets)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "rubygems", | |
"application": { | |
"production": { | |
"rails_postgresql_host" : "", | |
"rails_postgresql_db": "", | |
"rails_postgresql_user": "", | |
"rails_postgresql_password": "", | |
"s3_key": "", | |
"s3_secret": "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ bundle update --verbose | |
Updating git://github.com/engageis/activerecord-postgres-hstore.git | |
Updating https://github.com/gregbell/active_admin.git | |
Updating https://github.com/jeffp/enumerated_attribute.git | |
Fetching gem metadata from https://rubygems.org/ | |
Query List: ["rails", "pg", "activerecord-postgres-hstore", "sass-rails", "coffee-rails", "uglifier", "asset_sync", "formtastic", "underscore-rails", "simple_form", "activeadmin", "meta_search", "devise", "haml", "haml-rails", "jquery-rails", "bootstrap-sass", "inherited_resources", "icalendar", "airbrake", "event-calendar", "holidays", "redis", "enumerated_attribute", "paperclip", "aws-sdk", "cancan", "mail_view", "newrelic_rpm", "vpim", "unread", "setler", "dotenv", "twilio-ruby", "rack-rewrite", "resque", "sinatra", "rails_autolink", "gibbon", "mixpanel", "dalli", "pry-rails", "rspec-rails", "faker", "heroku", "rails-erd", "guard", "guard-rspec", "sextant", "brakeman", "mailcatcher", "better_errors", "binding_of_caller", "timecop", "factory_girl_rails", " |
OlderNewer