Skip to content

Instantly share code, notes, and snippets.

View dbuarque's full-sized avatar

Dio Ianakiara dbuarque

View GitHub Profile
@dbuarque
dbuarque / wordpress.php
Created April 22, 2012 17:34 — forked from cogentParadigm/wordpress.php
Automated Wordpress Installer
#!/usr/bin/php
<?php
$usage = "Automated Wordpress installer\nby Ali Gangji\nUsage: wordpress install_dir -u dbuser -p dbpass -d dbname\nOptions:\n";
$usage .= " -u dbuser Database username\n";
$usage .= " -p dbpass Database password\n";
$usage .= " -d dbname Database name\n";
$usage .= " -h dbhost Database host\n";
$usage .= " --private Hide blog from search engines\n";
$usage .= " --prefix prefix Database prefix\n";
if ($argc < 2) {
@dbuarque
dbuarque / gist:3049280
Created July 4, 2012 20:08 — forked from bihe/init.d play
init.d script to launch Play framework under Ubuntu
#!/bin/sh
### BEGIN INIT INFO
## END INIT INFO
# Path to play install folder
PLAY_HOME=/usr/share/play
PLAY=$PLAY_HOME/play
# Path to the JVM
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk
@dbuarque
dbuarque / purge-cache.sh
Created August 7, 2012 17:59 — forked from cosimo/purge-cache.sh
Script to purge varnish cache by URL, by regexp or all of it (for Debian)
#!/bin/sh
# purge-cache: Script to purge varnish cache. Defaults are defined in
# /etc/default/varnish.
#
# Cosimo <cosimo@cpan.org>
# Based on reload-vcl, by Stig Sandbeck Mathisen <ssm at debian dot org>
# Settings
defaults=/etc/default/varnish
@dbuarque
dbuarque / app-td-agent.conf
Created October 10, 2012 00:43 — forked from glidenote/app-td-agent.conf
fluentd conf files
# appサーバ用の設定
<source>
type tail
path /var/log/nginx/access.log
format apache
tag nginx.access
pos_file /var/log/td-agent/nginx.pos
</source>
<match nginx.access>
@dbuarque
dbuarque / app-td-agent.conf
Created December 3, 2012 17:22 — forked from glidenote/app-td-agent.conf
fluentd conf files
# appサーバ用の設定
<source>
type tail
path /var/log/nginx/access.log
format apache
tag nginx.access
pos_file /var/log/td-agent/nginx.pos
</source>
<match nginx.access>
<snippet>
<content><![CDATA[[
{
id: 1,
name: 'Batarang',
img: 'http://25.media.tumblr.com/tumblr_l7s7b3PTAt1qzpwi0o1_500.jpg',
price: 80
},
{
id: 2,

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@dbuarque
dbuarque / gist:5401858
Created April 17, 2013 04:45
charitysound fixed nav
<div id="nav-roll">
<div id="nav-mini" class="row">
<div class="container">
<div class="span8" style="padding: 4px;">
<img src="img/logo-mini.png" alt=""/>
</div>
</div>
</div>
<div id="nav-roll-data" class="row">
@dbuarque
dbuarque / gist:5423588
Created April 19, 2013 22:14
hover caption nice!
<div class="grid-block-container">
<div class="grid-block standard">
<div class="caption">
<h3>Caption Title</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<p><a href="#" class="learn-more">Learn more</a></p>
</div>
<img src="images/image-001.jpg" />
<h4>Normal</h4>

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one