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
// version 0.11 by Daniel Rench | |
// More information: http://dren.ch/strftime/ | |
// This is public domain software | |
Number.prototype.pad = | |
function (n,p) { | |
var s = '' + this; | |
p = p || '0'; | |
while (s.length < n) s = p + s; | |
return s; |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<!-- An example of using JQuery to make looping clouds. --> | |
<head> | |
<title>Transition Test</title> | |
<style> | |
#frame { | |
width: 600px; |
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
# A script to create a new project. Just download, chmod it to 755, then try: | |
# bunk project_name | |
project_name = ARGV[0] | |
`mkdir #{project_name} #{project_name}/lib #{project_name}/bin` | |
files = { | |
"LICENSE.txt" => %{(The MIT License) | |
Copyright (c) 2009 thefifthcircuit. |
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
// a simple pure-AS3 DynamicEvent class | |
package com.thefifthcircuit.utils { | |
import flash.events.Event; | |
public dynamic class DynamicEvent extends Event { | |
public function DynamicEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false) { | |
super(type, bubbles, cancelable) | |
} | |
} | |
} |
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 com.thefifthcircuit.utils { | |
public class Locator { | |
private static var obj:* = {}; | |
private function shallowGet(query:String):* { | |
var parsed:String = "^" + query + "$"; | |
var matches:Array = []; | |
for(var key:String in obj) { | |
if(key.match(new RegExp(parsed))) { |
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
# based off of video quality chart at http://chadvonnau.com/youtube.html and | |
# the Amazon S3 pricing chart at http://aws.amazon.com/s3/#pricing | |
# | |
# 2000 users a day for a month, each watching an hour of Hulu-quality video | |
# would cost $64.79/month. | |
# | |
# 5000 users a day for a month, each watching 15 minutes of Hulu-quality video | |
# would cost $40.49/month. | |
require 'activesupport' |
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
// Thanks to James Podolsey for this code, from the "Monitoring DOM | |
// Properties" article, located at | |
// http://james.padolsey.com/javascript/monitoring-dom-properties/ | |
jQuery.fn.watch = function(id, fn) { | |
return this.each(function() { | |
var self = this, oldVal = self[id]; | |
$(self).data('watch_timer', | |
setInterval(function() { |
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
~/projects/jruby ➔ cat remote_rhino.rb | |
require 'java' | |
$CLASSPATH << 'http://mirrors.ibiblio.org/pub/mirrors/maven2/rhino/js/1.7R2/js-1.7R2.jar' | |
ctx = org.mozilla.javascript.Context.enter | |
scope = ctx.init_standard_objects nil | |
result = ctx.evaluate_string scope, 'function f(x){return x+1} f(7)', 'x', 1, nil | |
puts result |
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 'sinatra/base' | |
module PaypalSample | |
class App < Sinatra::Base | |
get "/" do | |
@business_name = "" | |
@login = "[email protected]" | |
@amount = "1.00" | |
@return_url = "" | |
@cancel_url = "" |
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 'sinatra/base' | |
module CortadoSample | |
class App < Sinatra::Base | |
get "/" do | |
%{<video controls width="640" height="480"> | |
<source src="BigBuckBunny.ogv" type="video/ogg" /> | |
<!--<source src="video.mp4" type="video/mp4" />--> | |
<applet code="com.fluendo.player.Cortado.class" archive="cortado.jar" width="640" height="480"> |