Skip to content

Instantly share code, notes, and snippets.

View jarodreyes's full-sized avatar

Jarod Reyes jarodreyes

View GitHub Profile
@jarodreyes
jarodreyes / recordings_controller.rb
Created August 21, 2015 16:59
All recordings for a phone number
# 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 = []
@jarodreyes
jarodreyes / bizcard.xml
Created August 3, 2015 14:58
Bizcard TwiML
<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>
[["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]]
@jarodreyes
jarodreyes / codesyntax.less
Created April 17, 2015 19:10
Prevent scroll when user is not in focus mode
// 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;
@jarodreyes
jarodreyes / app.rb
Created March 17, 2015 21:52
Taco Tuesday Code
# 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'"
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
@jarodreyes
jarodreyes / candy-sms.rb
Created February 26, 2015 03:20
3rdSpace Candy Machine
# 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)
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])
<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>
@jarodreyes
jarodreyes / gist:7479517
Created November 15, 2013 05:21
leaderboard.json for The Hacker Olympics.js.
{"1":{"points":1080,"name":"Bajoran raider"},"2":{"points":290,"name":"Basestars"},"3":{"points":940,"name":"Bebop"},"4":{"points":605,"name":"Bellerophon"},"5":{"points":410,"name":"Blackbird"},"6":{"points":350,"name":"Cardassian Pursuit"},"7":{"points":510,"name":"Colonial Viper"},"8":{"points":585,"name":"Cylon Raider"},"9":{"points":790,"name":"Death Glider"},"10":{"points":545,"name":"Destiny Ascension"},"11":{"points":415,"name":"Enterprise"},"12":{"points":825,"name":"Event Horizon"},"13":{"points":550,"name":"Federation Fighter"},"14":{"points":535,"name":"Geonosian starfighter"},"15":{"points":0,"name":"Heart of Gold"},"16":{"points":45,"name":"Horatius"},"17":{"points":0,"name":"Hyperion"},"18":{"points":0,"name":"Icarus"},"19":{"points":0,"name":"Independence"},"20":{"points":0,"name":"Jedi starfighter"},"21":{"points":0,"name":"Jem'Hadar fighter"},"22":{"points":0,"name":"Kronos Fighter"},"23":{"points":0,"name":"Magellan"},"24":{"points":0,"name":"Mayflower One"},"25":{"points":0,"name":"Minbari