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 |
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
<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
$("#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
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
#!/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
require 'rack/utils' | |
class FlashSessionCookieMiddleware | |
def initialize(app, session_key = '_session_id') | |
@app = app | |
@session_key = session_key | |
end | |
def call(env) | |
if env['HTTP_USER_AGENT'] =~ /^(Adobe|Shockwave) Flash/ |
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
$("#uploadify").uploadify({ | |
// Eval the response | |
'onComplete' : function(a, b, c, response){ eval(response) }, | |
// And set the accept header to application/javascript | |
'scriptData' : { | |
'<%%= session_key_name %>' : '<$%= u cookies[session_key_name] %>', | |
'_http_accept': "application/javascript" | |
}, |
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
# Rakefile | |
desc "Create new color swatches" | |
task :swatches do | |
require "yaml" | |
YAML.load_file("swatches.yml").each do |name, color| | |
p "Creating: #{name} (#{color}) => images/colors/#{name}.png" | |
%x[ convert -size 16x16 xc:white -draw "stroke #666666 fill white rectangle 0,0 15,15" -draw "stroke white fill #{color} rectangle 1,1 14,14" "images/colors/#{name}.png" ] | |
end |
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
# swatches.yml | |
black: "#0F0F0F" | |
blue: "#3055A0" | |
gray: "#949A9F" | |
green: "#4D8756" | |
light_green: "#92C14F" | |
navy: "#304264" | |
orange: "#DA7A2D" | |
red: "#C31E38" | |
teal: "#477D79" |
OlderNewer