Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
import sys
from fontTools import ttLib
FONT_SPECIFIER_NAME_ID = 4
FONT_SPECIFIER_FAMILY_ID = 1
def shortName( font ):
"""Get the short name from the font's names table"""
name = ""
family = ""
class PhoneCallsController < ApplicationController
def create
http = Net::HTTP.new('clients4.google.com', 443)
http.use_ssl = true
path = '/voice/embed/webButtonConnect'
request_params = params[:phone_call].map { |k, v| "#{ CGI.escape(k) }=#{ CGI.escape(v) }" }.join("&")
request_headers = {}
resp, data = http.post(path, request_params, request_headers)
$("#google-voice").submit(function(e){
e.preventDefault();
$.post("/phone_calls", $(this).serialize(), function(data){
if(data=="ok=true"){
console.log("success");
}
else{
console.log("failure");
<form id="google-voice" action="https://clients4.google.com/voice/embed/webButtonConnect" method="post">
<input type="hidden" name="phone_call[buttonId]" value="<YOUR API KEY>" />
<input type="hidden" name="phone_call[showCallerNumber]" value="1" />
<ul>
<li>
<label>Your Name</label>
<input type="text" name="phone_call[callerNumber]" />
</li>
@starrhorne
starrhorne / gist:466898
Created July 7, 2010 16:19
Cairo warped / curved text demo in ruby. Ported from example included in pycairo
require 'cairo'
require 'rubygems'
require 'ruby-debug'
def warp_path(context, &block)
first = true
context.copy_path.each do |type, points|
case type
task :cron => :environment do
@config = YAML.load_file("#{RAILS_ROOT}/config/helpdesk.yml")
@config = @config["EMAIL"]["incoming"][RAILS_ENV].to_options
@fetcher = Fetcher.create({:receiver => Helpdesk::TicketNotifier}.merge(@config))
@fetcher.fetch
end