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
| global.events = {}; | |
| // | |
| // Usage: | |
| // bind('editButton->clicked', function(arg) { | |
| // doStuff(arg); | |
| // }); | |
| // | |
| global.bind = function(eventName, callback) { |
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
| Object.new = function(arg) { | |
| var property; | |
| var prototype = arg.__prototype__ || object; | |
| var object = Object.create(prototype); | |
| for (property in arg) { | |
| if (arg.hasOwnProperty(property)) { | |
| object[property] = arg[property]; | |
| } | |
| } |
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
| // | |
| // "Framework" | |
| // | |
| window.object = Object.prototype; | |
| Object.define = function(arg) { | |
| var prototype = arg.__prototype__ || Object.prototype; | |
| var object = Object.create(prototype); | |
| var property; |
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
| Storage.prototype.set = (item, value) -> | |
| @setItem item, JSON.stringify value | |
| Storage.prototype.get = (item) -> | |
| return JSON.parse @getItem(item) | |
| Object.makeNonEnumerable Storage.prototype, ['set', 'get'] |
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
| # "Framework" | |
| Object.define = (arg) -> | |
| prototype = arg.__prototype__ || Object.prototype | |
| object = Object.create prototype | |
| for property of arg | |
| if arg.hasOwnProperty property | |
| object[property] = arg[property] | |
| delete object.__prototype__ |
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
| # prototypes | |
| dialog = __super__ = imports('/widgets/dialog.coffee').dialog | |
| resetButton = imports('/toolbar/reset-button.coffee').resetButton | |
| pauseButton = imports('/toolbar/pause-button.coffee').pauseButton | |
| skipButton = imports('/toolbar/skip-button.coffee').skipButton | |
| infobox = imports('/toolbar/infobox.coffee').infobox | |
| speedChartButton = imports('/toolbar/speed-chart-button.coffee').speedChartButton | |
| accuracyChartButton = imports('/toolbar/accuracy-chart-button.coffee').accuracyChartButton | |
| mostTypedButton = imports('/toolbar/most-typed-button.coffee').mostTypedButton |
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
| window.addEventListener('DOMContentLoaded', function() { | |
| window.addEventListener('load', function() { | |
| console.log('all loaded'); | |
| }); | |
| }); |
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
| #import "MainWindowController.h" | |
| #import <WebKit2/WKProcessGroup.h> | |
| #import <WebKit2/WKBrowsingContextGroup.h> | |
| #import <WebKit2/WebKit2.h> | |
| #import <WebKit2/WKPreferencesPrivate.h> | |
| #import <WebKit2/WKPageGroup.h> |
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
| spawnCocoaProcess: -> | |
| workingDirPath = process.argv[3] | |
| execPath = workingDirPath + '/Type Fu' | |
| env = process.env | |
| env['DYLD_FRAMEWORK_PATH'] = workingDirPath + '/../Frameworks' | |
| env['WEBKIT_UNSET_DYLD_FRAMEWORK_PATH'] = 'YES' | |
| nodeProcess = process | |
| cocoaProcess = spawn execPath, [client.port], |
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
| @implementation MySingleton | |
| static MySingleton* _instance = nil; | |
| +(id)alloc { | |
| @synchronized([MySingleton class]) { | |
| NSAssert(_instance == nil, @"Error. Don't use alloc on singloetons."); | |
| _instance = [super alloc]; | |
| return _instance; | |
| } |