Skip to content

Instantly share code, notes, and snippets.

View cdmwebs's full-sized avatar
🦕

Chris Moore cdmwebs

🦕
View GitHub Profile

Keybase proof

I hereby claim:

  • I am cdmwebs on github.
  • I am cdmwebs (https://keybase.io/cdmwebs) on keybase.
  • I have a public key whose fingerprint is 5AE0 2E7B 7374 14E5 1D5D 9059 4519 4E04 84FD 5328

To claim this, I am signing this object:

#!/bin/sh
HOST=cdmwebs.homedns.org
SOURCE=/Users/chris
INCLUDE=/Users/chris/bin/include.txt
PATHTOBACKUP=/media/storage/backups/panthera
PIDFILE=/Users/chris/bin/rsync.pid
# No more changes.
chris@panthera:~/Sites/magazine$ script/console
Loading development environment (Rails 2.3.2)
>> a = User.last
User Load (0.4ms) SELECT * FROM "users" ORDER BY users.id DESC LIMIT 1
=> #<User id: 2, name: "Andy", created_at: "2009-05-19 18:39:53", updated_at: "2009-05-19 18:39:53">
>> a.current_magazine = Magazine.create(:title => 'Moustache Monthly')
Magazine Create (0.4ms) INSERT INTO "magazines" ("updated_at", "title", "created_at") VALUES('2009-05-19 18:42:55', 'Moustache Monthly', '2009-05-19 18:42:55')
NoMethodError: SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
@cdmwebs
cdmwebs / cdmwebs_rails.rb
Created October 13, 2009 20:32
My default Rails template with Authlogic and Cucumber
# Set up .gitignore
file '.gitignore', <<-CODE
config/database.yml
log/*.log
tmp/**/*
.DS\_Store
.DS_Store
db/test.sqlite3
db/development.sqlite3
/log/*.pid
desc "Minify the javascript output by sprockets"
task :minimize_js => :environment do
begin
File.new("public/sprockets.js")
rescue
Rake::Task['sprockets:install_script'].invoke
end
require "lib/js_minimizer"
js = IO.readlines("public/sprockets.js", '').to_s
# set the current account
function hset() {
ln -nfs ~/.heroku/credentials.$1 ~/.heroku/credentials
}
# get the current account
function hget() {
readlink ~/.heroku/credentials | awk -F . '{print $NF}'
}
#!/usr/bin/env ruby
#-*-ruby-*-
# A script to run ctags on all .rb files in a project. Can be run on
# the current dir, called from a git callback, or install itself as a
# git post-merge and post-commit callback.
CTAGS = '/usr/local/bin/ctags'
HOOKS = %w{ post-merge post-commit post-checkout }
HOOKS_DIR = '.git/hooks'
require 'httparty'
require 'grit'
require 'pathname'
module Wikipedia
class Revision
def initialize(article, revision)
@article = article
@revision = revision
=gradient-bg($color, $top: 5, $bottom: $top)
@if $top < 0 and $bottom < 0
$color1: darken($color, abs($top))
$color2: lighten($color, abs($bottom))
+linear-gradient(color-stops($color1, $color2))
@else
$color1: lighten($color, abs($top))
$color2: darken($color, abs($bottom))
+linear-gradient(color-stops($color1, $color2))
background-color: $color
@cdmwebs
cdmwebs / template.rb
Created November 20, 2010 05:22
Rails 3 with options for devise, jquery, cucumber, capybara, rspec and mongoid
generators = []
puts 'Spinning up a new app, captain!'
devise = yes?('Use Devise? (yes/no)')
jquery = yes?('Use jQuery? (yes/no)')
jquery_ui = yes?('Use jQuery UI? (yes/no)') if jquery
mongoid = yes?('Use mongoid? (yes/no)')
haml = yes?('Use haml? (yes/no)')
rspec = yes?('Use Rspec? (yes/no)')