This is now an actual repo:
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
# | |
# = Capistrano database.yml task | |
# | |
# Provides a couple of tasks for creating the database.yml | |
# configuration file dynamically when deploy:setup is run. | |
# | |
# Category:: Capistrano | |
# Package:: Database | |
# Author:: Simone Carletti <[email protected]> | |
# Copyright:: 2007-2010 The Authors |
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 'csv' | |
require 'rexml/document' | |
class Person | |
@@counter = 0 | |
@@people = [] | |
attr_reader :id, :name | |
def self.find_or_initialize(name) |
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
RAILS SHELL APPLICATION IN 10 STEPS !!! | |
1.- rails shell -d mysql | |
2.- cd shell | |
3.- Edit config/database.yml | |
4.- rake db:create | |
5.- ruby script\generate scaffold Command execute:string | |
6.- rake db:migrate | |
7.- Delete public/index.html | |
8.- Edit config/routes.rb | |
map.resources :commands |
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
1.- rails jukebox -d mysql | |
2.- cd jukebox | |
3.- vi config/database.yml | |
4.- rake db:create:all | |
5.- ruby script/generate scaffold Artist name:string permalink:string albums_count:integer | |
6.- ruby script/generate scaffold Album artist:references title:string permalink:string | |
7.- Edit your db/migrate 001_create_artists migration file to initialize the counter cache for artists_count and add the index for the permalink column. | |
def self.up | |
create_table :artists do |t| |
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
project :test => :shoulda, :renderer => :haml, :stylesheet => :sass, :script => :jquery, :orm => :activerecord | |
#default routes | |
APP_INIT = <<-APP | |
get "/" do | |
"Hello World!" | |
end | |
get :about, :map => '/about_us' do | |
render :haml, "%p This is a sample blog created to demonstrate the power of Padrino!" |
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
directory "tmp" | |
file "tmp/hello.tmp" => "tmp" do | |
sh "echo 'Hello' > 'tmp/hello.tmp'" | |
end | |
task :default => 'morning:turn_off_alarm' | |
namespace :morning do | |
desc "Turn off alarm." |
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
VERSION="1.9.2" | |
PATCH="180" | |
DPKG_BUILD_ARCH="$(dpkg --print-architecture)" | |
set -e | |
DESTDIR="$(mktemp -d)" | |
debra create "$DESTDIR" | |
trap "debra destroy \"$DESTDIR\"" EXIT |
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
$.fn.extend | |
myplugin: (options) -> | |
self = $.fn.myplugin | |
opts = $.extend {}, self.default_options, options | |
$(this).each (i, el) -> | |
self.init el, opts | |
self.log el if opts.log | |
$.extend $.fn.myplugin, | |
default_options: |
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
Veewee::Session.declare( { | |
:cpu_count => '1', | |
:memory_size=> '256', | |
:disk_size => '10140', | |
:disk_format => 'VDI', | |
:disk_size => '10240' , | |
:os_type_id => 'Ubuntu', | |
:iso_file => "ubuntu-10.04.1-server-i386.iso", | |
:iso_src => "http://releases.ubuntu.com/10.04.1/ubuntu-10.04.1-server-i386.iso", | |
:iso_md5 => "01f72c846845e4e19aec8a45912e5dda", |
OlderNewer