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
// | |
// NSObject+BlockObservation.h | |
// Version 1.0 | |
// | |
// Andy Matuschak | |
// [email protected] | |
// Public domain because I love you. Let me know how you use it. | |
// | |
#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
// Puncture a closure, absolute madness | |
Function.prototype.puncture = function(){ | |
var wormhole = function(__cmd__){ | |
return eval(__cmd__); | |
}; | |
var source = ('' + this).match(/function.+?\{([\s\S]*)\}/)[1]; | |
var fn = new Function('this.wormhole=' + wormhole + '\n' + source); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>author</key> | |
<string>Thomas Aylott</string> | |
<key>comment</key> | |
<string>Thomas Aylott ㊷ subtleGradient.com</string> | |
<key>name</key> | |
<string>Brilliance Black (Inverted)</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
function Class(sup, pro) { | |
if (sup && typeof sup === 'object') | |
pro = sup, sup = Object; | |
var con = Object.getOwnPropertyDescriptor(pro, 'constructor'); | |
if (!con) | |
con = {value: Function(), writable: true, configurable: true}; | |
if (con.configurable) { | |
con.enumerable = false; |
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
// See comments below. | |
// This code sample and justification brought to you by | |
// Isaac Z. Schlueter, aka isaacs | |
// standard style | |
var a = "ape", | |
b = "bat", | |
c = "cat", | |
d = "dog", |
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
// Swap classes onload and domready | |
$(function(){ $('html').removeClass('not-ready').addClass('ready'); }); // jQuery | |
$(window).load(function(){ $('html').removeClass('loading').addClass('loaded'); }); | |
// target a specific version | |
if (navigator.isIE == 6){ | |
// do stuff for IE6 | |
} | |
// Deliever different behaviour for a group of IE versions |
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
#import <Foundation/Foundation.h> | |
@interface Communicator : NSObject <NSStreamDelegate> { | |
@public | |
NSString *host; | |
int port; | |
} | |
- (void)setup; |
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
Titanium.UI.setBackgroundColor('#000'); | |
//Main Tab Group | |
var tabGroup = Titanium.UI.createTabGroup(); | |
//Photo Selection Window | |
var photosWindow = Titanium.UI.createWindow({ | |
url:'photos.js', | |
title:'Photos', | |
backgroundColor:'#fff' |
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
Titanium.UI.setBackgroundColor('#000'); | |
//Main Tab Group | |
var tabGroup = Titanium.UI.createTabGroup(); | |
//Photo Selection Window | |
var photosWindow = Titanium.UI.createWindow({ | |
url:'photos.js', | |
title:'Photos', | |
backgroundColor:'#fff' |
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
(function() | |
{ | |
var _fnMap = {}; | |
$.fn.addClass = function(classes) | |
{ | |
var vs = this; | |
if(!(classes > '') || vs.length == 0) | |
return this; |
OlderNewer