Skip to content

Instantly share code, notes, and snippets.

# Observer
# ----------------
module Observable
def add_observer(observer)
observers.push(observer)
end
def remove_observer(observer)
@Mon-Ouie
Mon-Ouie / pixelation.rb
Created July 15, 2011 11:37 — forked from bil-bas/pixelation.rb
Pixelation shader in Ray
# Pixelation post-processing effect
# http://www.geeks3d.com/20101029/shader-library-pixelation-post-processing-effect-glsl/
# Shaders -------------------
PIXEL_SHADER =<<END
uniform sampler2D sceneTex; // 0
uniform float vx_offset;
uniform float rt_w; // GeeXLab built-in
uniform float rt_h; // GeeXLab built-in
#!/usr/bin/env ruby
require 'csv'
require 'net/http'
require 'open-uri'
require 'optparse'
require 'uri'
# You could have used %w[country_code country_name], but I think symbols make
# more sense for such fields.
@Mon-Ouie
Mon-Ouie / RedHeadsLikeItInThePink.rb
Created August 19, 2012 15:50 — forked from anonymous/RedHeadsLikeItInThePink.rb
the database insert doesnt loop but the puts do.
def mura_collect # naming conventions
# begin <- begin is implied in a function
#define function Variables
query_name = "Mura"
con = Mysql.new(DB_Host, DB_User, DB_Pass, DB_Table)
open(@mura_url,
"User-Agent" => "Firefox",
"From" => "[email protected]",
"Referer" => "http://www.google.com") { |f|