Skip to content

Instantly share code, notes, and snippets.

export PATH=/usr/local/narwhal/bin:$PATH
export PATH=/usr/local/narwhal/packages/tusk/bin:$PATH
source ~/.profile
tusk install closure-compiler
jake flatten
@eliaskg
eliaskg / gist:860115
Created March 8, 2011 10:11
Class creating problems with CPTextField
Object.prototype.disableRightClick = function(shouldDisable)
{
if (this._DOMElement)
var element = this._DOMElement;
else
var element = this;
element.oncontextmenu = shouldDisable ? function() { return false; } : null;
}
@eliaskg
eliaskg / gist:879431
Created March 21, 2011 13:13
Button theming in Cappuccino
@implementation CPButton (MyCostumButton)
- (void)setCustomTheme
{
var normalColorNormal = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:[
[[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] pathForResource:"controls/buttonNormalNormalLeft.png"] size:CGSizeMake(2, 24)],
[[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] pathForResource:"controls/buttonNormalNormalMiddle.png"] size:CGSizeMake(1, 24)],
[[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] pathForResource:"controls/buttonNormalNormalRight.png"] size:CGSizeMake(2, 24)]
] isVertical:NO]];
var ENV = require("system").env,
FILE = require("file"),
JAKE = require("jake"),
task = JAKE.task,
FileList = JAKE.FileList,
app = require("cappuccino/jake").app,
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
OS = require("os");
app ("MyApplication", function(task)
@implementation CalendarView: CPView
{
}
-(id)init {
self = [super initWithFrame:CGRectMake(0, 0, 200, 200)];
if (self) {
[self loadData];
}
return self;
@eliaskg
eliaskg / gist:1239244
Created September 24, 2011 11:59
Normal if
if (!item) {
createItem();
}
@eliaskg
eliaskg / gist:1239245
Created September 24, 2011 12:01
One Liner
if (!item)
createItem();