This file contains hidden or 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 'capistrano/recipes/deploy/strategy/base' | |
| require 'fileutils' | |
| require 'tempfile' # Dir.tmpdir | |
| require 'net/ssh' | |
| require 'net/sftp' | |
| require 'find' | |
| module Capistrano | |
| module Deploy |
This file contains hidden or 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
| <?php // get the value of "variable" from the URL | |
| $val = $_GET['variable']; | |
| ?> | |
| <?php | |
| if ( $val == "yeah" ) { | |
| echo "the variable is YEAH!"; | |
| } ?> | |
This file contains hidden or 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
| <!-- add the following code to your functions.php file --> | |
| <?php | |
| add_filter( 'sidebars_widgets', 'disable_all_widgets' ); | |
| function disable_all_widgets( $sidebars_widgets ) { | |
| if ( is_home() ) | |
| $sidebars_widgets = array( false ); | |
| return $sidebars_widgets; | |
| } |
This file contains hidden or 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
| # you can trap for nil entries in validations and validations are simple | |
| # you can always test it with .blank? | |
| # you can always convert nil values to empty strings by simply | |
| # adding .to_s | |
| # i.e. | |
| test = User.new | |
| test.name | |
| => nil | |
| test.name.to_s | |
| => "" |
This file contains hidden or 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
| # run psql as the postgres user | |
| psql -U postgres | |
| create role USERNAME with createdb login; | |
| \q | |
| # run psql as the newly created user | |
| psql -U USERNAME postgres | |
| create database DBNAME; | |
| \q |
This file contains hidden or 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
| mkdir /usr/local/src | |
| cd /usr/local/src | |
| wget url-for-latest-postgres-package | |
| tar xzf postgres...tgz | |
| cd postgres... | |
| ./configure --with-bonjour --with-openssl | |
| ./make | |
| ./make install |
This file contains hidden or 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
| randy-j-hunts-macbook-air-2:design-ignites-change randyjhunt$ rake gems:install | |
| (in /Users/randyjhunt/code/rails/design-ignites-change) | |
| gem install mislav-will_paginate --version "~> 2.2.3" --source http://gems.github.com | |
| WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and | |
| /usr/bin aren't both writable. | |
| WARNING: You don't have /Users/randyjhunt/.gem/ruby/1.8/bin in your PATH, | |
| gem executables will not run. | |
| Successfully installed mislav-will_paginate-2.2.3 | |
This file contains hidden or 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 - In textmate, open the bundle editor> Edit Languages | |
| 2 - pick Rails: HTML(rails) from the left hand thing | |
| 3 - Then change | |
| fileTypes = ( 'rhtml' ); | |
| to | |
| fileTypes = ( 'rhtml', 'html.erb' ); |
This file contains hidden or 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
| # configure RedirectPermanent in Apache vhost | |
| # step 1: new virtual hosts for each domain | |
| # step 2: RedirectPermanent in each new vhost file | |
| RedirectPermanent / http://mysite.org | |
| # put the RedirectPermanent inside a vhost for each mysite.com and mysite.net | |
| # RedirectPermanent is part of mod_alias | |
| # this was done so multiple domain extensions would all change to the same extension |
This file contains hidden or 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
| # common Rake commands | |
| # run migrations | |
| rake db:migrate | |
| # copy the database | |
| rake db:test:clone_structure | |
| # display all application routes | |
| rake routes |