Skip to content

Instantly share code, notes, and snippets.

View erotte's full-sized avatar
🏡
Arbeit Arbeit Arbeit

Eckhard Rotte erotte

🏡
Arbeit Arbeit Arbeit
View GitHub Profile
@erotte
erotte / gist:104005
Created April 29, 2009 19:41
.bash_profile @home
ORIG_PATH=$PATH
USER_PATH=/usr/local/sbin:~/bin:/usr/X11R6/bin
OPT_PATH=/opt/local/bin:/opt/local/sbin
PG_PATH=/opt/local/lib/postgresql82/bin
MYSQL_PATH=/opt/local/lib/mysql5/bin
DEV_PATH=$OPT_PATH:$MYSQL_PATH:$PG_PATH:$PATH:$USER_PATH
export PATH=$DEV_PATH
#! /bin/bash
sqlite3 -echo -bail ~/Library/Mail/Envelope\ Index vacuum;
IRB.conf[:AUTO_INDENT] = true
IRB.conf[:USE_READLINE] = true
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:PROMPT_MODE] = :SIMPLE
require 'rubygems'
require 'irb/completion'
require 'utility_belt'
require 'pp'
ActionController::Base.asset_host = Proc.new { |source|
source.starts_with?('/images') ? "liveorproductionapp.tld" : nil
}
// ===================================
// = Bullet Proof Popups, 1997 style =
// ===================================
Popup: {
base: function(url, options, popupName){
popupName = window.open(url,popupName,options);
if (popupName){
if (popupName.focus) popupName.focus();
}
return false;
run "echo TODO > README"
generate :nifty_layout
puts "configuring gems"
gem "sqlite3-ruby", :lib => "sqlite3"
gem 'haml'
gem "fastercsv", :lib => false
gem 'vlad', :lib => false
gem 'vlad-git', :lib => false
class ArticlesController < ApplicationController
# GET /articles
# GET /articles.xml
def index
@articles = Article.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @articles }
end
Xms512m -Xmx512m -XX:MaxPermSize=256m -XX:+UseParallelGC -XX:ParallelGCThreads=4 -XX:+UseAdaptiveSizePolicy -Xbootclasspath/a:../lib/boot.jar -ea
class DebugController < ApplicationController
# Many Thanks to Jens Himmelreich for the Idea!
def heapdump
living_objects = Hash.new 0
file_path = timestamp_filepath
ObjectSpace.each_object do |object|
living_objects[object.class] += 1
end
sorted_array = living_objects.sort{|a,b| b[1] <=> a[1] }
File.open(file_path, 'w') do |file|
# usage: rails new MY_NEW_APP -J -T -m <http://URL.of.this.file>
# Helpers
def git_update(message)
git :add => ".", :commit => "-m '#{message}'"
end
def git_remove(file)
git :rm => file