Skip to content

Instantly share code, notes, and snippets.

View jubishop's full-sized avatar
🎼
Making a podcast app.

Justin Bishop jubishop

🎼
Making a podcast app.
View GitHub Profile
package fbconnect {
import flash.external.ExternalInterface;
import flash.events.EventDispatcher;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.SecurityErrorEvent;
import flash.net.URLLoaderDataFormat;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
raise 'Usage: ruby blist.rb "[H]H:MM AM|PM" "[H]H:MM AM|PM"' unless ARGV.length == 2
def parse_date(date_str)
time, meridiem = date_str.split(/\s+/)
hour, minute = time.split(/:/).map{|i| i.to_i}
hour += 12 if meridiem == "PM"
hour = 0 if meridiem == "AM" && hour == 12
{:time => "#{hour}:#{minute}", :hour => hour, :minute => minute}
end
require 'rubygems'
require 'hpricot'
require 'open-uri'
doc = Hpricot(open("http://shirt.woot.com/Derby/Default.aspx"))
as = doc/"a"
File.open("newoot.html", "w+") { |file|
file.puts '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<div id="all"></div>
<script><!--
alert("in here at all");
var ajax = new Ajax();
ajax.responseType = Ajax.FBML;
ajax.ondone = function(data) {
alert("done");
document.getElementById('all').setInnerFBML(data);
}
#!/usr/bin/env ruby
require 'rubygems'
require 'rbosa'
raise "Need file name" if (ARGV.empty?)
fileName = ARGV.first
IO.popen("scp '#{fileName}' [email protected]:~/WebServer/public/tmp") {|io| io.read }
#!/usr/bin/env ruby
lines = STDIN.readlines.map{|line| line.strip }
lines.delete_if{|line| line.empty?}
items = Hash.new
line = lines[0]
items[line] ||= Array.new
curItem = items[line]
#!/usr/bin/env ruby
puts STDIN.readlines.map{|line|
if (line.include? "function" and line.match(/private|public|protected/))
leadingSpace = line.match(/^(\s*)/).captures.first
modifier = line.match(/(private|public|protected)/).captures.first
override = (line.include?("override") ? "override " : "")
static = (line.include?("static") ? "static " : "")
afterFunction = line.match(/function\s*(.+)$/).captures.first
"#{leadingSpace}#{static}#{override}#{modifier} function #{afterFunction}\n"
#!/usr/bin/env ruby
require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes.rb"
lines = STDIN.readlines
doc = lines.join
importRegex = /^\s*import /
classCapture = /\.(\w+)\s*;$/
packageCapture = /^\s*import\s+(\w+)/
require 'net/http'
require 'uri'
require 'digest/md5'
api_key = 'api_key_here'
session_key = 'session_key_here'
session_secret = 'session_secret_here
last_update = 0
prev_items = nil
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
applicationComplete="applicationComplete(event)" >
<mx:Script><![CDATA[
import mx.events.FlexEvent;
import mx.controls.Image;
import flash.events.Event;
private var imgURL:String = "http://xerto.free.fr/toad1.jpg";
private function applicationComplete(event:FlexEvent):void {