Skip to content

Instantly share code, notes, and snippets.

View dennisreimann's full-sized avatar
still hungry. still foolish.

d11n dennisreimann

still hungry. still foolish.
View GitHub Profile
# Rails template for initializing new projects
# Initialize git repository
git :init
# Delete unnecessary files
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"
run "rm public/robots.txt"
set :user, "dbloete"
set :domain, "the.domain.com"
set :application, "myapp"
set :deploy_to, "/var/www/#{application}"
set :repository, "[email protected]:#{user}/#{application}.git"
namespace :vlad do
desc "Symlinks the configuration files"
remote_task :symlink_config, :roles => :web do
%w(application.yml database.yml).each do |file|
require 'net/http'
require 'uri'
# /api/v1/:format/new
# /api/v1/:format/gists/:user
# /api/v1/:format/:gist_id
res = Net::HTTP.post_form(URI.parse('http://gist.github.com/api/v1/xml/new'),
{ 'files[file1.ab]' => 'CONTNETS',
'files[file2.ab]' => 'contents' })
#!/bin/bash
# This script will update your cappuccino installation with the
# current version of the provided branch (defaults to "master")
cd /usr/local/src/cappuccino/
branch=${1-"master"}
# update sources
git checkout -f -b $branch origin/$branch
git pull
# poor mans debugger
#
# if you want to know whats the value of an object just add .why?
# and you will see what it is and why your program behaves like it does.
#
Object.class_eval {def why?; raise "Because it is #{inspect}" ; end}
html, body, div, form, fieldset, legend, label {
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
From 22f184268e27474faf93b2d06893f42593b084e1 Mon Sep 17 00:00:00 2001
From: dbloete <[email protected]>
Date: Tue, 25 May 2010 22:07:35 +0200
Subject: [PATCH] Fix compass/sass deprecation warnings
---
Rakefile | 2 +-
stylesheets/_base.sass | 2 +-
stylesheets/_layout.sass | 2 +-
stylesheets/_library.sass | 12 +++---
# rubygems DNS is temporarily down, put this into your /etc/hosts to install gems,
# but don't forget to remove the entries once their DNS is back up again
72.4.120.124 rubygems.org
207.171.181.231 production.s3.rubygems.org
216.137.45.24 production.cf.rubygems.org
module AuthenticationHelpers
def current_user_session
return @current_user_session if defined?(@current_user_session)
@current_user_session = UserSession.find
end
def current_user
return @current_user if defined?(@current_user)
@current_user = current_user_session && current_user_session.user
@dennisreimann
dennisreimann / rp.sh
Created September 12, 2010 21:43
shell-script for opening several terminal tabs for a rails project
#!/bin/bash
if [ $# -ne 1 ]; then PATHDIR=`pwd`; else PATHDIR=~/Sites/"$1"; fi
/usr/bin/osascript <<EOF
set actions to {"./script/server", "bundle exec spork rspec", "bundle exec autospec", "git pull --rebase && mate ."}
on new_tab()
tell application "System Events" to tell process "Terminal" \
to keystroke "t" using command down