Skip to content

Instantly share code, notes, and snippets.

View lgs's full-sized avatar

Luca G. Soave lgs

View GitHub Profile
############################################################
# #
# Out of the box Clearance Rails authentication tamplate #
# basically follow the wiki installation guide @ github #
# http://wiki.github.com/thoughtbot/clearance/installation #
# #
# Build the complete skeleton for a Rails 2.3 application #
# using Clearance Auth. This generator will automatically #
# build the basics for a Rails authentication with email #
# and password. #
require 'sinatra/metal'
class SinatraMetal < Sinatra::Base
include Sinatra::Metal
get '/sinatra' do
'hello sinatra!'
end
end
@lgs
lgs / lark_template.rb
Created July 13, 2009 09:10
authlogic ++ template
# download and git methods swiped from http://github.com/Sutto/rails-template/blob/07b044072f3fb0b40aea27b713ca61515250f5ec/rails_template.rb
require 'open-uri'
def download(from, to = from.split("/").last)
#run "curl -s -L #{from} > #{to}"
file to, open(from).read
rescue
puts "Can't get #{from} - Internet down?"
exit!
root@webby2066:~# pstree
init-+-cron
|-dd
|-events/0
|-7*[getty]
|-khelper
|-klogd
|-ksoftirqd/0
root@webby2066:~# vmstat 1
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
0 5 165044 2728 212 6124 0 0 0 1 7 8 0 0 100 0
1 4 167060 2676 212 6316 236 3696 548 3700 972 330 0 0 79 21
0 4 173612 2300 224 5612 280 7592 404 7716 881 330 0 0 71 29
2 4 175220 2576 224 5544 232 2772 232 2772 973 300 0 0 76 24
0 4 175432 2344 212 5244 176 2004 176 2004 640 232 0 0 75 25
0 3 175452 2356 220 5352 64 1676 136 1724 787 245 0 0 75 25
1 3 175788 2124 220 4640 128 2308 128 2308 805 244 0 0 75 25
root@webby2066:~# ps -ef | grep rake
root 18916 18744 0 18:24 pts/0 00:00:00 /usr/bin/ruby1.8 /usr/bin/rake community_engine:test
root 18917 18916 0 18:24 pts/0 00:00:00 sh -c /usr/bin/ruby1.8 -I"lib:lib" "/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "vendor/plugins/community_engine/test/unit/vote_test.rb" "vendor/plugins/community_engine/test/unit/asset_test.rb" "vendor/plugins/community_engine/test/unit/friendship_test.rb" "vendor/plugins/community_engine/test/unit/photo_test.rb" "vendor/plugins/community_engine/test/unit/event_test.rb" "vendor/plugins ....
....
....
root@webby2066:~# strace -p 18916
Process 18916 attached - interrupt to quit
wait4(18917,
...
@lgs
lgs / post.textile
Created August 13, 2009 06:06 — forked from tekkub/post.textile
layout title
post
a facet of Facets

{{ page.title }}

29 Jul 2009 – Bethesda, MD

I just updated to Rails 2.3.3 and my controllers screamed:

root@webby2066:/var/rails/bookuntu# script/generate themed home
uninitialized constant Home
root@webby2066:/var/rails/bookuntu# script/generate themed Home
uninitialized constant Home
root@webby2066:/var/rails/bookuntu# script/generate themed HomeController
undefined method `columns' for HomeController:Class
root@webby2066:/var/rails/bookuntu# script/generate themed HomeController --layout=application
undefined method `columns' for HomeController:Class
root@webby2066:/var/rails/bookuntu# grep home config/routes.rb
/*
Jquery and Rails powered default application.js
Easy Ajax replacement for remote_functions and ajax_form based on class name
All actions will reply to the .js format
Unostrusive, will only works if Javascript enabled, if not, respond to an HTML as a normal link
respond_to do |format|
format.html
format.js {render :layout => false}
end
*/
@lgs
lgs / gist:256174
Created December 14, 2009 16:28 — forked from pauldix/gist:57285
require 'feedzirra'
# fetching a single feed
feed = Feedzirra::Feed.fetch_and_parse("http://feeds.feedburner.com/PaulDixExplainsNothing")
# feed and entries accessors
feed.title # => "Paul Dix Explains Nothing"
feed.url # => "http://www.pauldix.net"
feed.feed_url # => "http://feeds.feedburner.com/PaulDixExplainsNothing"
feed.etag # => "GunxqnEP4NeYhrqq9TyVKTuDnh0"