Skip to content

Instantly share code, notes, and snippets.

View ohayon's full-sized avatar

David Ohayon ohayon

  • Boston, MA
  • 20:29 (UTC -04:00)
View GitHub Profile
@ohayon
ohayon / MyLocation.m
Created December 23, 2012 21:33
Ray Wenderlich's MapKit Tutorial
//
// MyLocation.m
// MapTutorial
//
// Created by David Ohayon on 12/22/12.
// Copyright (c) 2012 David Ohayon. All rights reserved.
//
#import "MyLocation.h"
#import <AddressBook/AddressBook.h>
def index
if params(:state) == used
@coupons = Coupon.all(params[:state])
else
@coupons = Coupon.all
end
respond_to do |format|
format.html # index.html.erb
format.json { render json: @coupons }
@ohayon
ohayon / messages_controller.rb
Created November 12, 2012 02:50
trying to change action of button
def create
@message = Message.new(params[:message])
account_sid = 'AC99a8b8ee9bba15e33ee4cac8bb0e505a'
auth_token = 'f1adcf3b638369e574662fcad40e60f5'
if @message.save
begin
client = Twilio::REST::Client.new account_sid, auth_token
client.account.sms.messages.create(