Skip to content

Instantly share code, notes, and snippets.

View ryanwilliams's full-sized avatar
💭
I may be slow to respond.

Carbon Based Lifeform ryanwilliams

💭
I may be slow to respond.
View GitHub Profile
glEnable(GL_SCISSOR_TEST);
// Some region to clip to
CGRect rect = CGRect(100, 100, 200, 200);
CGRect frame = [[[CCDirector sharedDirector] openGLView] frame];
// Adjust for position
CGPoint worldPos = [self convertToWorldSpaceAR:position_];
RouteTool.mapController = SC.ObjectController.create(
/** @scope RouteTool.mapController.prototype */ {
overlayObjects: new Array(),
addRoute: function(sender, route) {
if (!route) {
var route = RouteTool.store.createRecord(RouteTool.Route, {
points: [[37.772323, -122.214897], [21.291982, -157.821856], [-18.142599, 178.431], [-27.46758, 153.027892]],
description: 'Test Route 1'
typeSelect: SC.SelectView.design({
controlSize: SC.SMALL_CONTROL_SIZE,
layout: { centerY: 0, height: 18, left: 210, width: 120 },
items: [
{title: 'Running', value: 'running', icon: 'select-button-icon'},
{title: 'Mountain biking', value: 'mountain biking', icon: 'select-button-icon'},
{title: 'Rambling', value: 'rambling', icon: 'select-button-icon'},
{title: 'Walking', value: 'walking', icon: 'select-button-icon'}
], // items
itemTitleKey: 'title',
NSSize frameSize = [_containerView frame].size;
NSRect rect = NSMakeRect(0, 0, frameSize.width, frameSize.height);
[[_listView view] setFrame:rect];
function python_bash_prompt {
echo `python ~/.dotfiles/bash_prompt.py`
}
PS1="$(python_bash_prompt) "
@ryanwilliams
ryanwilliams / gist:1858984
Created February 18, 2012 11:54
Cocos2D v0.2 example in CoffeeScript
# Pull in the modules we're going to use
cocos = require 'cocos2d' # Import the cocos2d module
nodes = cocos.nodes # Convenient access to 'nodes'
events = require 'events' # Import the events module
geo = require 'geometry' # Import the geometry module
# Convenient access to some constructors
Layer = nodes.Layer
Scene = nodes.Scene
Label = nodes.Label
widgetAtPoint: (point) ->
_widgetsInTouch = []
for widget,i in @widgets
continue if widget instanceof App.Views.TextWidget
if widget.getIsVisible() and widget.isPointInside(point)
_widgetsInTouch[i] = widget
_widgetsInTouch.sort (a, b) ->