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
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |
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
/* ------------------------------ Main Class ------------------------------ */ | |
// Returns "instances" of itself which are actually functions. | |
function Ben ( greeting ) { var Parent, scope | |
function Scope () { | |
// Here is where you put your normal constructor junk | |
this.greeting = greeting | |
this.colours = [ 'yellow', 0xFFFFFF ] | |
} | |
// Magic |
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
# how to install boehm gc on OS X | |
task :clean do | |
sh "rm -rf gc" if File.exists?("gc") | |
end | |
task :checkout do | |
#sh "curl -O http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.2alpha4.tar.gz" | |
#sh "tar zxf gc-*.tar.gz && rm gc-*.tar.gz" | |
#sh "mv gc-* gc" |
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
Black: 0, 0, 0 | |
Red: 229, 34, 34 | |
Green: 166, 227, 45 | |
Yellow: 252, 149, 30 | |
Blue: 196, 141, 255 | |
Magenta: 250, 37, 115 | |
Cyan: 103, 217, 240 | |
White: 242, 242, 242 |
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
# simple event dispatcher implementation | |
module Evented | |
class Dispatcher < Array | |
def call *args; self.each do |e|; e.call *args end end | |
end | |
class Dispatchers < Hash | |
def call name, *args; self[name].call(*args) if self[name] end | |
end | |
NewerOlder