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

Liquid Rendering
Assignment
with 'values' => ["foo", "bar", "baz"]
"{% assign foo = values %}.{{ foo[0] }}."
should == ".foo."
"{% assign foo = values %}.{{ foo[1] }}."
should == ".bar."
"{% assign foo = values %}.{{ foo[2] }}."
should == ".baz."
@jacquescrocker
jacquescrocker / gist:2001302
Created March 8, 2012 14:44
responsive.is bookmarklet
javascript:(function()%7Bvar%20location=(%22http://responsive.is/%22+window.location.host+window.location.pathname);if(location.substring(location.length-1)==%22/%22)%7Blocation=location.substring(0,location.length-1);%7Dwindow.location=location;%7D)();
/Users/jc/.rvm/rubies/ruby-1.9.2-p180-patched/lib/ruby/1.9.1/psych.rb:148:in `parse': couldn't parse YAML at line 115 column 48 (Psych::SyntaxError)
from /Users/jc/.rvm/rubies/ruby-1.9.2-p180-patched/lib/ruby/1.9.1/psych.rb:148:in `parse_stream'
from /Users/jc/.rvm/rubies/ruby-1.9.2-p180-patched/lib/ruby/1.9.1/psych.rb:119:in `parse'
from /Users/jc/.rvm/rubies/ruby-1.9.2-p180-patched/lib/ruby/1.9.1/psych.rb:106:in `load'
from /Users/jc/.rvm/gems/ruby-1.9.2-p180-patched@test/gems/rails_config-0.2.3/lib/rails_config/sources/yaml_source.rb:17:in `load'
from /Users/jc/.rvm/gems/ruby-1.9.2-p180-patched@test/gems/rails_config-0.2.3/lib/rails_config/options.rb:21:in `block in reload!'
from /Users/jc/.rvm/gems/ruby-1.9.2-p180-patched@test/gems/rails_config-0.2.3/lib/rails_config/options.rb:20:in `each'
from /Users/jc/.rvm/gems/ruby-1.9.2-p180-patched@test/gems/rails_config-0.2.3/lib/rails_config/options.rb:20:in `reload!'
from /Users/jc/.rvm/gems/ruby-1.9.2-p180-patched@test/gems/rails_config-0.2.3/lib/rails_
@jacquescrocker
jacquescrocker / database.rb
Created April 10, 2011 19:50
configures padrino to use config/mongoid.yml
# config/database.rb
config_file = Padrino.root("config", "mongoid.yml")
if File.exists?(config_file)
settings = YAML.load(ERB.new(File.read(config_file)).result)[Padrino.env.to_s]
::Mongoid.from_hash(settings) if settings.present?
end
@jacquescrocker
jacquescrocker / Gemfile
Created October 16, 2012 10:13
Gemfile for DeployButton.com
# deploybtn Gemfile
source 'https://rubygems.org'
gem "rake", ">= 0.9.2"
gem 'rails', ">= 3.2.7"
gem 'json'
gem "rails_config", "0.2.5"
gem "guid"
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 \
> --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib \
> --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26 \
> --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include \
> --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
Building native extensions with: '--with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib'
This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/*
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>:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>URL</key>
<string>https://www.google.com/</string>
</dict>
</plist>
@jacquescrocker
jacquescrocker / _screens.sass
Created January 17, 2013 21:34
Block Mixins (sass 3.2). You can use these like:
// defines some media block mixins for use
//
// e.g.
// +phone-landscape-and-down
// float: none
// margin-left: 20px
//
$media-phone-landscape: 480px
$media-tablet-portrait: 768px