Skip to content

Instantly share code, notes, and snippets.

View andrewsardone's full-sized avatar

Andrew Sardone andrewsardone

View GitHub Profile
pushd ~/code/project
git remote add jungledisk /Volumes/JungleDisk/Git/project.git
git push --all jungledisk
@andrewsardone
andrewsardone / gist:236185
Created November 16, 2009 18:26
Does Safari not respect the TCP port as part of the origin?
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$.ajax({
type: 'POST',
url: 'http://localhost:5984/andrewfun',
contentType: "application/json",
data: '{"foo":"bar"}',
#/etc/apache2/httpd.conf
#
...
#
# Proxy Server directives.
#
<IfModule mod_proxy.c>
ProxyRequests On
# Thanks to the Same Origin Policy, with CouchDB running port 5984, the browser will reject
# requests made to the database.
#
# Configure the CouchDB backend to communicate on port 80 by setting up Apache as a reverse proxy.
# thanks to http://www.syamantics.com/talk-to-your-couchdb-backend-directly-from-javascript
# in /etc/apache2/httpd.conf on Snow Leopard
<VirtualHost *:80>
ProxyRequests Off
<Proxy *>
@andrewsardone
andrewsardone / runix.rb
Created November 17, 2009 21:04 — forked from manuel/runix.rb
print "You have no mail.\n"
10000.times {
'$ '.display
gets.each do | e |
if (e == "uname\n")
puts "Runix 1.0"
elsif (e == "halt\n")
exit
else
This is a test of the emacs gist mode
~/code/activemessaging_fun$ ./script/poller run
ActiveMessaging: adapter reliable_msg not loaded: no such file to load -- reliable-msg
ActiveMessaging: adapter wmq not loaded: no such file to load -- wmq/wmq
"/Users/andrew/code/activemessaging_fun"
"/Users/andrew/code/activemessaging_fun/config/messaging.rb"
ActiveMessaging: Loading /Users/andrew/code/activemessaging_fun/app/processors/application.rb
ActiveMessaging: Loading /Users/andrew/code/activemessaging_fun/app/processors/hello_world_processor.rb
=> Subscribing to /queue/HelloWorld (processed by HelloWorldProcessor)
connect to localhost failed: Connection refused - connect(2) will retry(#0) in 5
#!/usr/bin/env ruby -wKU
plist_path = ENV['HOME'] + '/Library/LaunchAgents/com.blacktree.quicksilver.plist'
plist_content = <<-EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
> tig
command not found: tig
> brew install tig
==> Downloading http://jonas.nitro.dk/tig/releases/tig-0.15.tar.gz
######################################################################## 100.0%
==> ./configure --disable-debug --prefix=/usr/local/homebrew/Cellar/tig/0.15
==> make install
/usr/local/homebrew/Cellar/tig/0.15: 3 files, 164K, built in 6 seconds
# thanks Hans
module ActiveRecord
class Base
def self.random
if (c = count) != 0
find(:first, :offset =>rand(c))
end
end
end