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.ApplicationAdapter = DS.RESTAdapter.extend({ | |
host: 'http://hackerbarapp.com', | |
buildURL: function (type, id) { | |
var s = this._super("api", id); | |
console.log("URL: ", s); | |
return s + "?version=v1&api_key=2659a3fd-2f13-40ed-86ca-b7a40692979c"; | |
}, | |
pathForType: function(type) { | |
if (type == "api") { | |
return "api"; |
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 Numeric | |
def ugly? | |
self == 0 || self % 2 == 0 || self % 3 == 0 || self % 5 == 0 || self % 7 == 0 | |
end | |
end | |
# lines.each do |line| | |
orig_arr = line.strip.split(//) | |
line_arr = line.strip.gsub(/(0+)/, "0").split(//) # replace multiple zeros with one (for speed) |
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
<iframe width="512" height="288" src="http://www.hulu.com/embed.html?eid=ltswvhy0clvhymb7egakig&et=266&st=243" frameborder="0" scrolling="no" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe> |
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
# your Twilio authentication credentials | |
ACCOUNT_SID = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' | |
ACCOUNT_TOKEN = 'YYYYYYYYYYYYYYYYYYYYYYYYYYYY' | |
# version of the Twilio REST API to use | |
API_VERSION = '2010-04-01' | |
# base URL of this application | |
BASE_URL = "localhost:3000" #production ex: "http://appname.heroku.com/callme" |
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
xml.instruct! | |
xml.Response do | |
xml.Say "Your appointment is located in a building near a road." | |
xml.Redirect @redirectto | |
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
xml.instruct! | |
xml.Response do | |
xml.Say "Good bye." | |
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
xml.instruct! | |
xml.Response do | |
xml.Gather(:action => @postto, :numDigits => 1) do | |
xml.Say "Hello. The Twilio API is pretty awesome." | |
xml.Say "Please press 1 to repeat this menu. Press 2 for directions. Or press 3 if you are done." | |
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
Callme::Application.routes.draw do | |
match ':controller(/:action(.:format))' | |
match ':controller(/:action(/:id(.:format)))' | |
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
<h1>Twilio API demo</h1> | |
<h2 style="color: #ff0000"><%= params['msg'] %></h2> | |
<h3>Enter your phone number</h3> | |
<form action="/callme/makecall" method="post"> | |
<input type="text" name="number" /> | |
<input type="submit" value="Call me!"> | |
</form> |
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
avariable = PDFKit.new(File.read("#{Rails.root}/tmp/somepage.html")) | |
OlderNewer