This file contains hidden or 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
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; |
This file contains hidden or 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
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 | |
This file contains hidden or 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 '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"> |
This file contains hidden or 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
<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); | |
} |
This file contains hidden or 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/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 } |
This file contains hidden or 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/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] |
This file contains hidden or 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/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" |
This file contains hidden or 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/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+)/ |
This file contains hidden or 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 '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 |
This file contains hidden or 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
<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 { |