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
-module(my_behaviour). | |
-export([behaviour_info/1]). | |
%% init/1, some_fun/0 and other/3 are now expected callbacks | |
behaviour_info(callbacks) -> [{init,1}, {some_fun, 0}, {other, 3}]; | |
behaviour_info(_) -> undefined. |
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 "rubygems" | |
require "mechanize" | |
require "cgi" | |
require "csv" | |
require "active_record" | |
require "./lib/colorize_output" | |
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 "rubygems" | |
require "mechanize" | |
require "cgi" | |
require "csv" | |
require 'digest/sha1' | |
require "image_downloader" | |
class PhotoFetcher |
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
/** | |
* Module dependencies. | |
*/ | |
var express = require('express') | |
, routes = require('./routes') | |
, http = require('http'); | |
var app = express(); | |
var server = app.listen(3000); |
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
#!/bin/bash -xe | |
#THIS SCRIPT MUST BE RUN AS ROOT | |
#configure SSH | |
SSH_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAuwaDITgrsmxVvSJ+HEir4iW2eBb8XqB3wIxCWJwmhiB2S6MkdX1CFcj8boHL2RIYgKN0yiTCVlOdQFjhyRpnd8NbS0RW7753SE1hzkgOg+2e1B15lf1PCSD5OPWAtpb1eYlLcs6hns+yFhYCFeQrKLBL2/si8D8OcQcTR7BjjFQEWdhjl4cYiT68cr57yFT+c/f32ZTynEWukC2YIGMjJ1nACUOYF8CSp6RUrD2kY3C1Pb1Q5V3jwi0lhay4aF5AWp28hPVtYASBe2BrYXp8uErhnmWxgXNV19P0NSHE7TBXd9nXz/njI2SDP/p2N/vHquz/Ybxs4F+kGGXknUFitQ== [email protected]" | |
echo $SSH_KEY >> /home/ubuntu/.ssh/authorized_keys | |
#configure locale | |
echo "export LANGUAGE=en_AU.UTF-8" > /tmp/locale |
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
nginx_version = "1.2.6" | |
download_url = "http://nginx.org/download/nginx-#{nginx_version}.tar.gz" | |
file_path = "#{Chef::Config[:file_cache_path]}/nginx-#{nginx_version}.tar.gz" | |
remote_file file_path do | |
owner "root" | |
group "root" | |
mode 00644 |
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
# first install pgsql with home brew | |
brew install postgresql | |
# at this point, you need to be sure you have /usr/local/bin before /usr/bin on your $PATH | |
# to see, run: | |
brew doctor | |
# if doctor does not complain about this issue you can pass this step. | |
# prepend /usr/local/bin to your PATH in your ~/.bash_profile |
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
{ | |
:thumb => [142, 106], | |
:box_iphone => [296, 222], | |
:box_normal => [219, 164], | |
:box_large => [450, 340], | |
:normal => [600, 450] | |
}.each do |name, dimensions| | |
retina_name = "#{name}_retina" |
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
# In ruby < 2.0 we should implement this on our own. | |
def something_useful(opts = {}) | |
opts = opts.merge({ overridden_opt: :something, another_overridden_opt: :something_else }) | |
do_something_useful_with(opts[:overridden_opt]) if suitable?(opts[:another_overridden_opt]) | |
end | |
# In new ruby 2.0 we can implement this behavior easily thanks to keyword_arguments. |
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
.highlight { | |
background-color: #efefef; | |
padding: 7px 7px 7px 10px; | |
border: 1px solid #ddd; | |
-moz-box-shadow: 3px 3px rgba(0,0,0,0.1); | |
-webkit-box-shadow: 3px 3px rgba(0,0,0,0.1); | |
box-shadow: 3px 3px rgba(0,0,0,0.1); | |
margin: 20px 0 20px 0; | |
overflow: hidden; |