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
def get_upload_url(meta) | |
xml_entry = build_xml_entry(meta) | |
headers = { | |
'Authorization' => meta[:client_login] ? %Q(GoogleLogin auth="#{meta[:client_login]}") : %Q(AuthSub token="#{meta[:auth_sub]}"), | |
'X-GData-Client' => YT_CONFIG['auth_sub']['client_key'], | |
'X-GData-Key' => "key=#{YT_CONFIG['auth_sub']['developer_key']}", | |
'Content-Length' => xml_entry.length.to_s, | |
'Content-Type' => "application/atom+xml; charset=UTF-8" | |
} | |
response = connection.post('/action/GetUploadToken', xml_entry, headers) |
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
$('#search-submit').click(function(event){ | |
event.preventDefault(); | |
$.ajax({ | |
type: 'GET', | |
url: '/companies/autocomplete.js', | |
data: 'q='+$('input#search').val(), | |
dataType: 'json', | |
success: function(msg){ | |
for(var i=0; i < msg.length; i++) { | |
$('#company_suggestions').append('<li><input type="checkbox" name="dispute[company_ids][]" value="'+msg[i].company.id+'" id="dispute_company_'+msg[i].company.id+'" /> <label for="dispute_company_'+msg[i].company.id+'"><strong>'+msg[i].company.name+'</strong>: '+msg[i].company.description+'</label></li>') |
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
h1. Setting up a new Slice with Sprinkle! | |
"Sprinkle is a software provisioning tool you can use to build remote servers with. eg. to install a Rails or Merb stack on a brand new slice directly after its been created" | |
http://github.com/crafterm/sprinkle/tree/master | |
# Passenger-stack: http://github.com/benschwarz/passenger-stack/tree/master | |
# Configure Apache virtual host |
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
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:585:in `load': Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceResponse does not refer class/module (TypeError) |
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
require 'drb' | |
Adhearsion = DRbObject.new_with_uri "druby://192.168.0.58:9050" | |
options = { :channel => 'SIP/flowroute/16163186739', | |
:exten => '16164055286', | |
:priority => '1', | |
:context => 'outgoing' } | |
Adhearsion.originate options |
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
require 'rubygems' | |
require 'wirble' | |
require 'pp' | |
Wirble.init | |
script_console_running = ENV.include?('RAILS_ENV') && IRB.conf[:LOAD_MODULES] && IRB.conf[:LOAD_MODULES].include?('console_with_helpers') | |
rails_running = ENV.include?('RAILS_ENV') && !(IRB.conf[:LOAD_MODULES] && IRB.conf[:LOAD_MODULES].include?('console_with_helpers')) | |
irb_standalone_running = !script_console_running && !rails_running | |
if script_console_running |
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
export PS1='\[\033[0;35m\]\u:\[\033[0;33m\] \W\[\033[00m\]: ' |
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 Snow Leopard | |
* install latest xCode | |
* download, install MySQL X86_64 | |
* install mysql gem | |
** sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config | |
* update gems | |
* fix other gems that build native extensions(sphinx?, rmagick, nokogiri, etc…) | |
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
require "rubygems" | |
require 'scrobbler' | |
require 'tinder' | |
user = Scrobbler::User.new('nsain') | |
output = "#{user.username}'s Top 5 Weekly Artists\n" + ("-" * (user.username.length + 30)) + "\n" | |
user.weekly_artist_chart[0..4].each {|t| output += "#{t.name} (#{t.playcount})\n" } | |
campfire = Tinder::Campfire.new('subdomain') |
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
<!DOCTYPE> | |
<html> | |
<head> | |
<script type="application/javascript"> | |
// https://developer.mozilla.org/en/Canvas_tutorial | |
function draw() { | |
var canvas = document.getElementById('canvas'); | |
if (canvas) { |
OlderNewer