This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'cairo' | |
require 'rubygems' | |
require 'ruby-debug' | |
def warp_path(context, &block) | |
first = true | |
context.copy_path.each do |type, points| | |
case type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder