Skip to content

Instantly share code, notes, and snippets.

@cmaxw
cmaxw / template1.txt
Created October 10, 2009 04:55
Rails Templates
gem "cucumber"
gem "webrat", :version => '>= 0.4.4'
gem "rspec"
gem "rspec-rails"
gem "daemons"
gem "nifty-generators"
plugin(:annotate_models, :svn => "http://repo.pragprog.com/svn/Public/plugins/annotate_models")
plugin(:daemon_generator, :git => "git://github.com/dougal/daemon_generator.git")
#!/usr/bin/ruby
require 'rubygems'
require 'fastercsv'
meeting_times = []
FasterCSV.foreach("night.csv") do |row|
row[1].split(",").each do |time|
row[2].split(",").each do |day|
@cmaxw
cmaxw / datastaxCommunity.bash
Created February 28, 2012 03:56
DataStax Community install script
#!/bin/bash
# Use Oracle Sun Java
wget http://javadl.sun.com/webapps/download/AutoDL?BundleId=59621
mv AutoDL?BundleId=59621 jre-6u31-linux-i586.bin
sudo mkdir -p /opt/java/32
sudo mv ./jre-6u31-linux-i586.bin /opt/java/32
sudo chmod 755 /opt/java/32/jre-6u31-linux-i586.bin
cd /opt/java/32
sudo ./jre-6u31-linux-i586.bin
@cmaxw
cmaxw / gist:2217590
Created March 27, 2012 16:14
homebaserouter.js.coffee
class App.HomebaseRouter extends Backbone.Router
routes:
"all": 'allEvents'
"predecision": 'predecision'
"onboarding": 'onboarding'
"departure": 'departure'
"arrival": 'arrival'
"spending": 'spending'
@cmaxw
cmaxw / rubyrogues.conf
Created July 31, 2013 16:37
nginx config (that doesn't work)
server {
server_name rubyrogues.com www.rubyrogues.com rubyrogues.bluebox-placeholder.com;
access_log /var/log/nginx/rubyrogues.com.access.log;
error_log /var/log/nginx/rubyrogues.com.error.log;
root /var/www/rubyrogues;
passenger_enabled on;
passenger_base_uri /parley;
rails_env production;
require 'csv'
module Baseballer
class Batter
attr_accessor :attributes
def self.load(file_path = "../../data/Batting-07-12.csv")
path_to_file = File.expand_path(file_path, File.dirname(__FILE__))
batters = []
CSV.foreach(path_to_file, headers: true, return_headers: false) do |row|
Generated at 2013-10-08 13:56:58 +0000
Chef::Mixin::Template::TemplateError:
Chef::Mixin::Template::TemplateError (undefined method `each' for nil:NilClass) on line #5:
3:
4: <% @apache_listen_ports.each do |port| -%>
5: <% @apache_listen_addresses.each do |address| -%>
6: Listen <%= address.length > 0 ? "#{address}:" : '' %><%= port %>
7: <% end -%>
@cmaxw
cmaxw / chef-stacktrace.out
Last active December 26, 2015 12:08
Trying to create a database from a recipe
opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/client.rb:193:in `fork'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/client.rb:193:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/application.rb:183:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/application/client.rb:302:in `block in run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/application/client.rb:294:in `loop'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/application/client.rb:294:in `run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/application.rb:66:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.2/bin/chef-client:26:in `<top (required)>'
/usr/bin/chef-client:23:in `load'
/usr/bin/chef-client:23:in `<main>'^C

Hack Night Ideas

  • 5 minute Rails setup. (ie. if config options are missing, launch a form to get them in the browser.)
  • "Rate this page" service (from Parley. Embeddable via JS for static sites.)
  • Cohort plugin for devise, sorcery, or similar
  • Cohort analytics (see above)
  • Chat room (EM, Node, etc.)
  • Survey plugin with simple markup language/DSL
@cmaxw
cmaxw / Mealplan.md
Last active December 8, 2017 22:50
Fitness Plan

Meal Plan

Breakfast - 520 calories

  • 2 eggs(scrambled)
  • 2 slices bacon
  • 2 slices toast (buttered)

Lunch (A Day) - 420 calories

  • Campbells Chunky Soup (1 can)