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
# nginx | |
description "nginx http daemon" | |
author "George Shammas <georgyo@gmail.com>" | |
start on (filesystem and net-device-up IFACE=lo) | |
stop on runlevel [!2345] | |
env DAEMON=/usr/sbin/nginx | |
env PID=/var/run/nginx.pid |
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
class User < ActiveRecord::Base | |
end | |
class Book < ActiveRecord::Base | |
end | |
module CustomerRole | |
end | |
class AddToCartContext |
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
echo "Install Ruby..." | |
sudo apt-get update | |
sudo apt-get install build-essential libssl-dev zlib1g-dev libreadline-dev | |
export ruby_version=1.9.3-p194 | |
cd /usr/src | |
sudo wget "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-$ruby_version.tar.bz2" | |
sudo tar xf "./ruby-$ruby_version.tar.bz2" | |
sudo rm "./ruby-$ruby_version.tar.bz2" |
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
# download and build nginx from sources | |
https://gist.github.com/3083579 |
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
# | |
# Paperclip convert id => id_partition | |
# | |
require 'fileutils' | |
class PaperclipExtend | |
def self.obtain_class | |
class_name = ENV['CLASS'] || ENV['class'] | |
uploads_path = ENV['UPLOADS_PATH'] || ENV['uploads_path'] | |
raise "Must specify CLASS" unless class_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
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |
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
#!/usr/bin/env ruby | |
require './dancer' | |
require './gangnam_style' | |
dancer = Dancer.new('PSY', GangnamStyle.new) | |
dancer.dance! |
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
# | |
# SPIM S20 MIPS Simulator. | |
# Makefile for SPIM. | |
# | |
# SPIM is covered by a BSD license. | |
# | |
# Copyright (c) 1990-2010, James R. Larus. | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without modification, |
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
#!/usr/bin/env ruby | |
require 'logger' | |
require 'active_record' | |
require 'active_record/base' | |
require 'active_support' | |
ActiveRecord::Base.logger = Logger.new("log/mysql_to_postgresql.log") | |
PROCESSES = 8 |