Skip to content

Instantly share code, notes, and snippets.

Avatar
🇸🇬

Moritz Angermann angerman

🇸🇬
View GitHub Profile
@angerman
angerman / 0_reuse_code.js
Created Jan 29, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View post-build-hook.sh
#!/usr/bin/env bash
source "${HALCYON_DIR}/src.sh"
post_build_hook () {
expect_vars HALCYON_BASE
local tag source_dir constraints
expect_args tag source_dir build_dir -- "$@"
label=$( get_tag_label "${tag}" )
View gist:72755
/*
* AppController.j
*
* Created by __Me__ on __Date__.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*/
@import <Foundation/CPObject.j>
@import "Checkbox.j"
View gist:73144
@implementation ZebraList : CPCollectionView
{
CPView _backgroundFrame;
}
+ (void)initialize
{
backgroundImage = [[CPImage alloc] initWithContentsOfFile: "Resources/ZebraList/bg.png" size: CPSizeMake(1, 40)];
}
-(id)initWithFrame:(CPRect)frame
{
View gist:74760
/* -*- coding: utf-8 -*-
*
* Starrater with a revised version from boucher from 280North
*/
@import <AppKit/CPControl.j>
@import <AppKit/CPImage.j>
var starEmpty = [[CPImage alloc] initWithContentsOfFile: "Resources/StarRater/empty.gif" size: CPSizeMake(25, 25)],
starSet = [[CPImage alloc] initWithContentsOfFile: "Resources/StarRater/set.gif" size: CPSizeMake(25, 25)],
View gist:74768
/* -*- coding: utf-8 -*-
*
* Starrater with a revised version from boucher from 280North
*/
@import <AppKit/CPControl.j>
@import <AppKit/CPImage.j>
var starEmpty = [[CPImage alloc] initWithContentsOfFile: "Resources/StarRater/empty.gif" size: CPSizeMake(25, 25)],
starSet = [[CPImage alloc] initWithContentsOfFile: "Resources/StarRater/set.gif" size: CPSizeMake(25, 25)],
View gist:74762
/* -*- coding: utf-8 -*-
*
* Starrater with a revised version from boucher from 280North
*/
@import <AppKit/CPControl.j>
@import <AppKit/CPImage.j>
var starEmpty = [[CPImage alloc] initWithContentsOfFile: "Resources/StarRater/empty.gif" size: CPSizeMake(25, 25)],
starSet = [[CPImage alloc] initWithContentsOfFile: "Resources/StarRater/set.gif" size: CPSizeMake(25, 25)],
View gist:74771
/*
* AppController.j
*
* Created by __Me__ on __Date__.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*/
@import <Foundation/CPObject.j>
@import "StarRatingView.j"
View gist:77347
/* -*- coding: utf-8 -*-
* Created by Moritz Angermann on 6. March 2009.
* Copyright 2009 Moritz Angermann. All rights reserved.
*/
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
@angerman
angerman / gist:77392
Created Mar 11, 2009
fixing the event queue for the CPTextField
View gist:77392
diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j
index 40ac8c5..d83c0e0 100644
--- a/AppKit/CPTextField.j
+++ b/AppKit/CPTextField.j
@@ -129,6 +129,7 @@ var _CPTextFieldSquareBezelColor = nil,
if (!CPTextFieldDOMInputElement)
{
CPTextFieldDOMInputElement = document.createElement("input");
+ CPTextFieldDOMInputElement.isActive = NO;
CPTextFieldDOMInputElement.style.position = "absolute";