Right now, this assumes you are using Snow Leopard.
Homebrew is MacPorts (or APT) without the suck. http://github.com/mxcl/homebrew
sudo iptables -F | |
sudo iptables -A INPUT -i lo -j ACCEPT | |
sudo iptables -A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT | |
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
sudo iptables -A OUTPUT -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport 10000 -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport 3333 -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport 3000 -j ACCEPT |
# This plugin is used to automatically restart the Passenger Rails | |
# Useful if the Rails site is hooked into CC.rb and served by Passenger | |
# at the same time. | |
class Passenger | |
def initialize(project = nil) | |
@project = project | |
end | |
def build_finished(build) |
mysql -h HOST -u USERNAME --password=PASSWORD DATABASE -B -e "SELECT id,email,first_name,last_name,state,zip_code FROM users" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > filename.csv |
# getting the facebook permanent session key. | |
s = Facebooker::Session.new( "API_KEY", "SESCRET_KEY") | |
s.auth_token = "THE_6_DIGIT_CODE" | |
s.secure! :generate_session_secret => false | |
puts s.session_key |
page_id = 102329749861 | |
params = { | |
:v => '1.0', | |
:api_key => FACEBOOKER["api_key"], | |
:method => 'stream.get', | |
:format => 'XML', | |
:source_ids => page_id, | |
:session_key => 'bd7156a08fefbd368b54d2da-54500509', | |
:limit => 2 |
# http://code.google.com/codejam/contest/dashboard?c=32003#s=p1 | |
#2 | |
#WRWWLWWLWWLWLWRRWRWWWRWWRWLW WWRRWLWLWWLWWLWWRWWRWWLW | |
#WW WW | |
require 'ruby-debug' | |
class Cell | |
attr_accessor :x, :y, :walls |
require 'rubygems' | |
require 'eventmachine' | |
require 'evma_httpserver' | |
require 'cgi' | |
class Room < EM::Channel | |
end | |
$room = Room.new | |
$welcome_html = DATA.read |
var gameTrigger = [ | |
{ | |
when: 2 | |
,delayMin: 4 /* time between creep spawns */ | |
,delayMax: 5 | |
,multiplier: 1 | |
,creeps: [ | |
{ count: 5, type: Soot } | |
,{ count: 5, type: SootLevel2 } | |
,{ count: 4, type: Soot } |
Right now, this assumes you are using Snow Leopard.
Homebrew is MacPorts (or APT) without the suck. http://github.com/mxcl/homebrew
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby | |
# - a browser with WebSocket support | |
# | |
# Usage: | |
# ruby redis_pubsub_demo.rb | |
# |