Skip to content

Instantly share code, notes, and snippets.

View jacquescrocker's full-sized avatar

Jacques Crocker jacquescrocker

View GitHub Profile

Send Text Messages and Make Phone Calls with Node

The Node Knockout is nigh! As you make last minute preparations for your weekend masterpiece, you may be planning Android, iOS, and browser-based UI for your application. But there's another client platform that's even more ubiquitous - that's the telephone, particularly mobile phones. If you'd like to create experiences for all these devices, Twilio can help you get it done.

In this tutorial, we'll explore how to use the Twilio module for node.js to make and receive phone calls and text messages. This is slightly adapted from a series of introductory blog posts on the Twilio module, which are worth checking out as well if you're interested!

Getting Started

In order to use the Twilio API, you will first need to sign up for a free account. If you sign up with th

/*
This widget shows Recent Posts on your Tumblr blog.
Its dependency is jQuery.
Usage:
1) Add html:
<div id="recent-posts"></div>
2) Add code into the <head>:
$(".resend_auth").live "click", (e) ->
e.preventDefault()
link = $(this)
$.ajax
url: link.attr("href")
dataType: "json"
success: (json) ->
alert(json.msg)
@jacquescrocker
jacquescrocker / gist:1318784
Created October 27, 2011 04:35 — forked from mattetti/gist:1318670
google cloud print pointers
# this works with oauth 0.5.1
client = OAuth2::Client.new(CLIENT_ID, CLIENT_SECRET,
:authorize_url => "/o/oauth2/auth",
:token_url => "/o/oauth2/token",
:site => 'https://accounts.google.com/')
redirect_uri = "#{SERVER_URL}/oauth2callback"
get '/auth' do
module Sinatra
module AmbiguousRoutes
module RouteWithAmbiguousPath
def route(verb, path, options={}, &block)
# don't modify routes that already defined with a format extension
case path
when Regexp
else
if path =~ /\..*$/
$ = jQuery
$.fn.extend
myplugin: (options) ->
self = $.fn.myplugin
opts = $.extend {}, self.default_options, options
$(this).each (i, el) ->
self.init el, opts
self.log el if opts.log
$.extend $.fn.myplugin,
$.fn.extend
myplugin: (options) ->
self = $.fn.myplugin
opts = $.extend {}, self.default_options, options
$(this).each (i, el) ->
self.init el, opts
self.log el if opts.log
$.extend $.fn.myplugin,
default_options:
#!/usr/bin/env ruby
require 'bundler'
Bundler.require
Mongoid.configure do |config|
config.master = Mongo::Connection.new.db('foo')
end
class Author
include Mongoid::Document
references_many :books,:inverse_of => :author
file 'Gemfile', <<-GEMS
source 'http://gemcutter.org'
gem "rails", "3.0.0.rc1"
gem "bson_ext"
gem "mongoid", "2.0.0.beta.12"
gem "haml", ">= 3.0"
gem "compass", "0.10.0.rc4"
group :test do
gem "rspec-rails", ">= 2.0.0.beta.12"
#!/usr/bin/env sh
source "$HOME/.rvm/scripts/rvm"
rvm default
__rvm_load_rvmrc
cd .
export BUNDLE_PATH=$GEM_HOME
exec ruby "$@"