An implementation of Conway's Game of Life in 140 characters of Ruby.
Created by Simon Ernst (@sier).
admin_authenticator do |routes| | |
# Put your admin authentication logic here. | |
# If you want to use named routes from your app you need | |
# to call them on routes object eg. | |
# routes.new_admin_session_path | |
# Admin.find_by_id(session[:admin_id]) || redirect_to(routes.new_admin_session_path) | |
if current_user | |
if session[:customer_id] | |
current_customer = Customer.find_by_id(session[:customer_id]) | |
redirect_to(routes.customers_path) if !current_customer |
It's 8:00 o'clock on a Friday | |
The regular crowd shuffles in | |
there's an old man sitting next to me | |
making love to his beer | |
la la di di da | |
la la di di da | |
Sing us a song, you're the piano man! | |
sing us a song tonight |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
--colour | |
-I app |
An implementation of Conway's Game of Life in 140 characters of Ruby.
Created by Simon Ernst (@sier).
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf
using homebrew.
require "money" | |
class Decorator < BasicObject | |
undef_method :== | |
def initialize(component) | |
@component = component | |
end | |
def method_missing(name, *args, &block) |
user www-user; | |
worker_processes 1; | |
error_log logs/error.log; | |
error_log logs/error.log notice; | |
error_log logs/error.log info; | |
pid logs/nginx.pid; |
# Set cache dir | |
proxy_cache_path /var/cache/nginx levels=1:2 | |
keys_zone=microcache:5m max_size=1000m; | |
# Virtualhost/server configuration | |
server { | |
listen 80; | |
server_name yourhost.domain.com; | |
# Define cached location (may not be whole site) |
class Monopoly | |
constructor: (serverSide, popupsManager) -> | |
player = new Player(PlayerAttributes) | |
playerView = new PlayerView | |
playerController = new PlayerController(player, playerView) | |
(..) | |
class PlayerView | |
update: (player) -> | |
$("#player_score").text(player.points) |