Skip to content

Instantly share code, notes, and snippets.

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
# 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
# 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
=> ""
<!-- 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;
}
@randyjhunt
randyjhunt / gist:87674
Created March 30, 2009 07:29
Get variable from URL
<?php // get the value of "variable" from the URL
$val = $_GET['variable'];
?>
<?php
if ( $val == "yeah" ) {
echo "the variable is YEAH!";
} ?>
require 'capistrano/recipes/deploy/strategy/base'
require 'fileutils'
require 'tempfile' # Dir.tmpdir
require 'net/ssh'
require 'net/sftp'
require 'find'
module Capistrano
module Deploy
<div class="single">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet suscipit mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus mollis, justo sit amet fringilla laoreet, eros orci gravida velit, non lobortis dolor erat quis orci. Suspendisse imperdiet laoreet tortor, at luctus nunc consequat ut. Fusce eu mi eros. Suspendisse sed arcu velit, ac commodo sem. Donec sit amet eros hendrerit lacus feugiat facilisis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet suscipit mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus mollis, justo sit amet fringilla laoreet, eros orci gravida velit, non lobortis dolor erat quis orci. Suspendisse imperdiet laoreet tortor, at luctus nunc consequat ut. Fusce eu mi eros. Suspendisse sed arcu velit, ac commodo sem. Donec sit amet eros hendrerit lacus feugiat facilisis.</p>
</div>
<div class="double_left">
<img src="img/sample_project210_160.png" width="340" alt="Sample Project1">
<div class="image_meta">2008, HD video, 7 min 5s. Edition of 5.</div>
</div>
<div class="double_right">
<img src="img/sample_project210_160.png" width="340" alt="Sample Project1">
<div class="image_meta">2008, HD video, 7 min 5s. Edition of 5.</div>
</div>
<div class="triple_left">
<img src="img/sample_project210_160.png" width="220" alt="Sample Project1">
<div class="image_meta">2008, HD video, 7 min 5s. Edition of 5.</div>
</div>
<div class="triple_center">
<img src="img/sample_project210_160.png" width="220" alt="Sample Project1">
<div class="image_meta">2008, HD video, 7 min 5s. Edition of 5.</div>
</div>
<div class="triple_right">
<img src="img/sample_project210_160.png" width="220" alt="Sample Project1">
<div class="triple_left">
This is a section with text. To the right, is an empty section with no content and then a section with an image. In order to keep the structure in the empty section, it needs at least 1 piece of content: a "non-breaking space". See the code example below.
</div>
<div class="triple_center">
&nbsp;
</div>
<div class="triple_right">
<img src="img/sample_project210_160.png" width="220" alt="Sample Project1">
<div class="image_meta">2008, HD video, 7 min 5s. Edition of 5.</div>
</div>