Skip to content

Instantly share code, notes, and snippets.

View tolmasky's full-sized avatar

Francisco Ryan Tolmasky I tolmasky

View GitHub Profile
function mainRunLoop()
{
track_1();
[CPApp nextEventMaskMask:blah inMode:CPDefaultRUnLoopMode callback:mainRunLoop];
}
function track_1()
{
track_2();
[CPApp nextEventMaskMask:blah inMode:CPDefaultRUnLoopMode callback:track_1];
- (void)postEvent:(CPEvent)anEvent
{
if (_eventListeners.length)
{
if (_eventListeners[_eventListeners.length - 1]._mask & (1 << [anEvent type]))
{
var eventListener = _eventListeners.pop();
_currentMode = eventListener.mode();
eventListener._callback(anEvent);
-(void)run {
NSAutoreleasePool *pool=[NSAutoreleasePool new];
[self finishLaunching];
[pool release];
_isRunning=YES;
do {
pool = [NSAutoreleasePool new];
method("returner", #
{
return 5;
});
method 'returner' #
{
return 5;
}
for (var i = 0, count = [externalConnections count]; i < count; i++)
{
var thisConnection = externalConnections[i],
cachedConnection = externalConnectionCache[[thisConnection objectForKey:"index"]];
if ([[self class] documentForObject:[cachedConnection destination]] === self)
{
can we just do image.src = "thatURL"; image.onerror = function() { image.src = "thatURL+RANDOM"; image.onerror = function() { for sure no go; } }
image = new Image();
var imageLoaded = false;
image.onload = function() { imageLoaded = true; }
image.src = dataURL;
while (!imageLoaded)
sleep(10);
- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag
{
if (itemIdentifier == @"cheese")
{NSLog(@"asking for it");
if (!item)
{
item = [[X alloc] initWithItemIdentifier:itemIdentifier];
[item setLabel:@"HELLO THERE"];
[item setPaletteLabel:@"HELLO THERE"];
var ObjectiveJ = { };
#define wrap(filename) \
(function (global, exports) \
{ \
var undefined;
#include filename \
})(window, ObjectiveJ)