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
<html> | |
<head> | |
<style> | |
.arc path { stroke: #fff; } | |
</style> | |
<script src="https://dl.dropboxusercontent.com/u/10861681/blog-post/d3.v3.min.js"></script> | |
</head> | |
<body> | |
</body> |
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
before do | |
@twilio_number = ENV['TWILIO_NUMBER'] | |
@points_number = ENV['POINTS_NUMBER'] | |
@client = Twilio::REST::Client.new ENV['TWILIO_ACCOUNT_SID'], ENV['TWILIO_AUTH_TOKEN'] | |
puts "num: #{@twilio_number}" | |
end | |
route :get, :post, '/points' do | |
puts 'points/' | |
@phone_number = Sanitize.clean(params[:From]) |
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
# Register a subscriber through the web and send verification code | |
route :get, :post, '/sms-register' do | |
@phone_number = Sanitize.clean(params[:From]) | |
@body = params[:Body] | |
puts @error | |
if @error == false | |
user = AnonUser.first_or_create(:phone_number => @phone_number) | |
if not @body.nil? | |
user.messages.create(:body => @body) |
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 Appointment < ActiveRecord::Base | |
validates :name, presence: true | |
validates :phone_number, presence: true | |
validates :time, presence: true | |
after_save :notify | |
@@REMINDER_TIME = 10.minutes # minutes before appointment | |
attr_accessor :time |
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
# 3rdSpace Taco Tuesday webhook | |
# Phone Number: 6692382267 | |
# Register a subscriber through the web and send verification code | |
route :get, :post, '/tacos' do | |
@phone_number = Sanitize.clean(params[:From]) | |
@body = params[:Body] | |
puts "******************* ERROR: #{@error} **********************" | |
puts "******************* BODY: #{@body} **********************" | |
@options = "Please type: 'chicken', 'pork', 'fish' or 'vegetarian'" |
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
// Before the user is in 'focus' mode. | |
.cw-code, .cw-prose { | |
&:after { | |
content: " "; | |
display: block; | |
position: absolute; | |
width: 100%; | |
height: 100%; | |
top:0px; | |
left:0px; |
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
[["Item","Weight","Value"],["HP",4.8,500],["Visual c++",4.38,30],["Apple Laptop",3.6,700],["Joystick (Big)",2.9,120],["Joystick (small)",2.2,75],["Powerpoint Book",1.7,20],["Battery 2",1.375,90],["Sincerely Nuts",1.25,10],["Beef Jerky",1.1,15],["Battery 1",1.078125,90],["Beans",1,10],["Palm Keyboard",0.5,35],["Webcam 1",0.46875,50],["WEbcam 2 (sphere)",0.46875,50],["KIND bars",0.4375,12],["Palm VII",0.41875,200],["Palm Tuncsten",0.40625,300],["Nokia ANimal",0.390625,300],["Nokia Blue",0.3625,300],["Camera",0.3359375,200],["Splitter",0.3125,15],["Gateway Mouse",0.265625,30],["Sprint",0.25,200],["LG",0.234375,100],["PacBell Mouse",0.21875,50],["Razor Prototype",0.203125,900],["Flashlight",0.078125,10],["TOTAL:",30.7346875,4412]] |
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
<response> | |
<message to="params[:Body]">Jarod Reyes: Documentation at Twilio.com | |
Telephone: (206)650-5813 | |
Email: jreyes@twilio.com | |
Twitter: https://twitter.com/jreyesdesign | |
This SMS business card was built in 22 lines of code using Twilio. View the code on Github. | |
</message> | |
</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
# GET /recordings/:agent | |
def show | |
@agent_number = params[:agent] | |
@recordings = recordings_for_agent(@agent_number) | |
end | |
def call_sids(number) | |
# store the sids here | |
@call_sids = [] |
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
before_filter :iphone_redirect | |
def iphone_redirect | |
if request.env["HTTP_USER_AGENT"][/(Mobile\/.+Safari)/] | |
redirect_to "http://itunes.apple.com/us/app/messageparty/id386579657?mt=8" | |
end | |
end | |
describe ApplicationController do | |
it 'should redirect request from mobile safari to the app store' do |
OlderNewer