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
/usr/local/lib/ruby/gems/1.8/gems/sproutcore-0.9.19/lib/sproutcore/library.rb:378:in `load_environment!': (eval):88:in `load_environment!': compile error (SyntaxError) | |
(eval):19: syntax error, unexpected ']', expecting kEND | |
from /usr/local/lib/ruby/gems/1.8/gems/sproutcore-0.9.19/lib/sproutcore/library.rb:366:in `eval' | |
from /usr/local/lib/ruby/gems/1.8/gems/sproutcore-0.9.19/lib/sproutcore/library.rb:378:in `load_environment!' | |
from /usr/local/lib/ruby/gems/1.8/gems/sproutcore-0.9.19/lib/sproutcore/library.rb:366:in `initialize' | |
from /usr/local/lib/ruby/gems/1.8/gems/sproutcore-0.9.19/lib/sproutcore/library.rb:37:in `new' | |
from /usr/local/lib/ruby/gems/1.8/gems/sproutcore-0.9.19/lib/sproutcore/library.rb:37:in `library_for' | |
from /usr/local/lib/ruby/gems/1.8/gems/sproutcore-0.9.19/lib/sproutcore.rb:11:in `library' | |
from /usr/local/lib/ruby/gems/1.8/gems/sproutcore-0.9.19/bin/sc-server:41 | |
from /usr/local/bin/sc-server:19:in `load' |
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
<%= form :action => resource(:uploads) do %> | |
<%= file_field :name => "file", :label => "file" %><br /> | |
<%= submit "send" %> | |
<% end =%> |
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 'hotcocoa' | |
include HotCocoa | |
application do |app| | |
# setting up our window with | |
window :size => [150, 50] do |win| | |
# now lets set up our layout | |
win.view = layout_view :mode => :horizontal do |layout| | |
layout.spacing = 5 | |
# make a button | |
b = button(:title => 'Hi!', :layout => { :align => :center}) |
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
puts "Hello world, I am testing out posting to gist from vim" |
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 search | |
@artists = Artist.find_all_by_festival_id(@festival.id, :conditions => ["name LIKE ?", "%#{params[:q]}%"]) | |
respond_to do |wants| | |
wants.js { render :json => @artists } | |
end | |
end |
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
it "should be ok" do | |
get "/api/fakeguid/events" | |
Rails.logger.info "#{response.inspect}" | |
response.should be_ok | |
end | |
# results of response.inspect | |
#<Rack::MockResponse:0x36a6898 @headers={"Content-Type"=>"text/html", "Content-Length"=>"414"}, @errors="", @original_headers={"Content-Type"=>"text/html", "Content-Length"=>"414"}, @body="<!DOCTYPE html>\n<html>\n<head>\n <style type=\"text/css\">\n body { text-align:center;font-family:helvetica,arial;font-size:22px;\n color:#888;margin:20px}\n #c {margin:0 auto;width:500px;text-align:left}\n </style>\n</head>\n<body>\n <h2>Sinatra doesn't know this ditty.</h2>\n <img src='/__sinatra__/404.png'>\n <div id=\"c\">\n Try this:\n <pre>get '/hello' do\n \"Hello World\"\nend</pre>\n </div>\n</body>\n</html>\n", @status=404> |
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
# be sure to gem install httparty, its a GREAT gem for | |
# working with these types of RESTful This is just a starting point. | |
# You will probably want to add a few more methods to the class that | |
# sets the account_sid, and account_token. | |
require "httparty" | |
class TwilioCall | |
include HTTParty | |
base_uri "https://api.twilio.com/" | |
#this is just your account credentials, replace them with your credentials | |
basic_auth ACCOUNT_SID, ACCOUNT_TOKEN |
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
Factory.define :hot_model do |f| | |
f.sequence(:unique_attr) {|i| "heidi_klum#{i}" } | |
end |
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 'json' | |
require 'mash' | |
file = File.read("./widget.json") | |
mash = Mash.new(JSON.parse(file)) | |
mash.tracks.each do |track| | |
`curl #{track.stream_url} > "~/immi/#{track.permalink}"` | |
end |
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 hexlify(msg) | |
msg.split("").collect { |c| c[0].to_s(16) }.join | |
end | |
def unhexlify(msg) | |
msg.scan(/../).collect { |c| c.to_i(16).chr }.join | |
end | |
puts hexlify("Hello World") |
OlderNewer