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 | |
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
# 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
/* ------------------------------ 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
// | |
// 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
$ git clone github:lenary/guides.git | |
Cloning into guides... | |
remote: Counting objects: 255, done. | |
remote: Compressing objects: 100% (216/216), done. | |
remote: Total 255 (delta 111), reused 163 (delta 35) | |
Receiving objects: 100% (255/255), 1.49 MiB | 564 KiB/s, done. | |
Resolving deltas: 100% (111/111), done. | |
$ cd guides | |
$ git remote -v |
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
NSButton *closeButton = [self standardWindowButton:NSWindowCloseButton]; | |
NSView *themeFrame = [closeButton superview]; | |
CGFloat buttonYOrigin = NSMaxY(themeFrame.frame)-34; | |
//Alter the button frames | |
NSRect closeFrame = closeButton.frame; | |
closeFrame.origin.y = buttonYOrigin; | |
closeButton.frame = closeFrame; |
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
module.exports = (function(){ | |
const MS = | |
{ seconds: 1000 | |
, minutes: 60 * 1000 | |
, hours: 60 * 60 * 1000 | |
, days: 24 * 60 * 60 * 1000 | |
, weeks: 7 * 24 * 60 * 60 * 1000 | |
, months: 30 * 7 * 24 * 60 * 60 * 1000 | |
, years: 365 * 24 * 60 * 60 * 1000 } |
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
#lang racket | |
(require parser-tools/lex | |
(prefix-in re- parser-tools/lex-sre) | |
parser-tools/yacc) | |
(provide (all-defined-out)) | |
(define-tokens a (NUM VAR)) | |
(define-empty-tokens b (+ - EOF LET IN)) | |
(define-lex-trans number | |
(syntax-rules () |
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
javascript:(function(){i=prompt("SRFI Number");window.location="http://srfi.schemers.org/srfi-"+i+"/srfi-"+i+".html";})() |
OlderNewer