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
// compile using: clang -fobjc-arc -framework AppKit bundlelessApplication.m -o bundleLess | |
// | |
// opens a NSApplication with dock icon and menu bar. NSRunningApplication will return no bundleURL for it | |
// | |
// via http://stackoverflow.com/questions/8137538/cocoa-applications-from-the-command-line | |
// and http://casperbhansen.wordpress.com/2010/08/15/dev-tip-nibless-development/ | |
#import <Foundation/Foundation.h> | |
#import <Cocoa/Cocoa.h> |
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
<?php | |
class BNFParserGenerator { | |
private $defs = []; | |
/** | |
* This converts the BNF string into a set of generator definitions | |
* that we can use later | |
* @param string $string |
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
#!/bin/php | |
<?php | |
/// TODO: | |
/// - Implement Backslash escapes | |
// An ADT-like type that can either be a normal value or a variable. | |
class Token { | |
// 0 = Normal; 1 = Variable; 2 = Error; 3 = None | |
public $kind = 0; | |
// Contains the string for the associated type. |
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
if (!window.Element) { | |
(function (prototype) { | |
function Element() {} | |
prototype.runtimeStyle.cssText = 'clip:rect(0 0 0 0);height:0;position:absolute;width:0'; | |
document.getElementsByTagName('head')[0].appendChild((window.Element = Element).prototype = prototype).attachEvent('onpropertychange', function (event) { | |
for (var name = event.propertyName, index = 0, element; element = document.all[index]; ++index) { | |
if (element !== prototype) { | |
element[name] = prototype[name]; |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |