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/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. | |
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
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' |
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
# Set up .gitignore | |
file '.gitignore', <<-CODE | |
config/database.yml | |
log/*.log | |
tmp/**/* | |
.DS\_Store | |
.DS_Store | |
db/test.sqlite3 | |
db/development.sqlite3 | |
/log/*.pid |
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
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 |
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
# 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}' | |
} |
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/echo '{"version": "1.1.0","host": "maps.google.com","request_address": true,"address_language": "en_US", "wifi_towers": [{"mac_address": "' $(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s | grep -o "\([0-9a-f]\{2\}:\)\{5\}[0-9a-f]\{2\}" | head -1 ) '","signal_strength": 8,"age": 0}]}' | sed -e 's/" /"/' -e 's/ "/"/g' > /tmp/post.$$ && curl -X POST -d @/tmp/post.$$ http://www.google.com/loc/json | sed -e 's/{/\n/g' -e 's/,/\n/g' |
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 'httparty' | |
require 'grit' | |
require 'pathname' | |
module Wikipedia | |
class Revision | |
def initialize(article, revision) | |
@article = article | |
@revision = revision |
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
=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 |
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
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)') |
OlderNewer