sudo mkdir /usr/local
sudo chown -R `whoami` /usr/local
curl -L http://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C /usr/local
brew install git
cd /usr/local
git init
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
# How to echobot with XMPP, BOSH, and Strophe | |
1. Setup ejabberd(http://www.ejabberd.im/) server and setup account [email protected] | |
NOTE: localhost should be enough. If you setup something else, make sure you add it at /etc/hosts like this | |
#/etc/hosts | |
127.0.0.1 localhost.local | |
NOTE: Also download Psi(http://psi-im.org/), and make sure you can connect to your ejabberd server. | |
2. Download strophe(http://code.stanziq.com/strophe/) and place it (eg: /Users/makoto/work/sample/strophejs-1.0) |
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
// ========================= | |
// SetInterval | |
// ========================= | |
// While not truly accurate, setInterval is still fairly good, time-wise. | |
// Better for things like a "one second tick" but not great for expensive | |
// code executed at small intervals as iterations can "stack". | |
// (ECMAScript 5 strict mode compatible) |
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
# Install pow | |
$ curl get.pow.cx | sh | |
# Install powder | |
$ gem install powder | |
# See that firewall is fucked | |
$ sudo ipfw show | |
00100 0 0 fwd 127.0.0.1,20559 tcp from any to me dst-port 80 in <- THIS ONE!!! | |
65535 81005 28684067 allow ip from any to any |
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
license: gpl-3.0 |
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
[jtimberman@centos6 ~]$ git clone git://github.com/opscode/chef-repo.git | |
Initialized empty Git repository in /home/jtimberman/chef-repo/.git/ | |
remote: Counting objects: 199, done. | |
remote: Compressing objects: 100% (118/118), done. | |
remote: Total 199 (delta 72), reused 161 (delta 48) | |
Receiving objects: 100% (199/199), 30.19 KiB, done. | |
Resolving deltas: 100% (72/72), done. | |
[jtimberman@centos6 ~]$ cd chef-repo | |
[jtimberman@centos6 chef-repo]$ mkdir cookbooks/example/recipes | |
[jtimberman@centos6 chef-repo]$ echo '{"run_list": ["recipe[example]"]}' >> solo.json |
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
app.get('/proxied_image/:image_url', function(request_from_client, response_to_client){ | |
sys.puts("Starting proxy"); | |
var image_url = request_from_client.params.image_url; | |
var image_host_name = url.parse(image_url).hostname | |
var filename = url.parse(image_url).pathname.split("/").pop() | |
var http_client = http.createClient(80, image_host_name); | |
var image_get_request = http_client.request('GET', image_url, {"host": image_host_name}); | |
image_get_request.addListener('response', function(proxy_response){ |
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 Api::RegistrationsController < Api::BaseController | |
respond_to :json | |
def create | |
user = User.new(params[:user]) | |
if user.save | |
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201 | |
return | |
else |
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
# If your workers are inactive for a long period of time, they'll lose | |
# their MySQL connection. | |
# | |
# This hack ensures we re-connect whenever a connection is | |
# lost. Because, really. why not? | |
# | |
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar) | |
# | |
# From: | |
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/ |
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
/* The code below should be included in a separate file using IE conditional comments | |
as it causes errors in IE8(+?) */ | |
/** | |
* DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML <IMG/>. | |
* Author: Drew Diller | |
* Email: [email protected] | |
* URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/ | |
* Version: 0.0.8a | |
* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license |
OlderNewer