Skip to content

Instantly share code, notes, and snippets.

libraries = glut GL GLU
frameworks = GLUT OpenGL Cocoa
OS = $(shell uname -s)
target = $(lastword $(filter-out Makefile,$(subst /, ,$(abspath Makefile))))
objects = $(patsubst %.c,%.o,$(wildcard *.c))
compile = gcc -Wall
fw = $(addprefix -framework ,$(frameworks))
var terminalSetFontFG256 = function (fg) {
sys.print(TERM_ESCAPE + '38;5;' + fg + 'm');
};
var terminalSetFontBG256 = function (bg) {
sys.print(TERM_ESCAPE + '48;5;' + bg + 'm');
};
Newt.components.Rating = new Class({
Extends: Newt.Widget,
Binds: [
'click'
],
options: {
rating: 0
},
"---------------------------------------------------------------------[Init]----
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
"------------------------------------------------------------------[General]----
set nocompatible
set encoding=utf8
filetype on
"filetype indent on
export PS1='\[\e[38;5;239m\][\[\e[38;5;244m\]\u\[\e[38;5;247m\]@\[\e[38;5;255m\]\h\[\e[38;5;239m\]: \[\e[38;5;221m\]\w\[\e[38;5;33m\]$(__git_ps1 " (%s)")\[\e[38;5;239m\]]\[\e[0m\] '
@jocafa
jocafa / Base.js
Created October 29, 2010 17:53
A simple class with tests
require('./mootools');
var util = require('util');
var Base = new Class({
Implements: [Events, Options],
options: {
},
initialize: function (opts) {
var
util = require('util'),
fs = require('fs'),
net = require('net'),
http = require('http'),
io = require('socket.io'),
EventEmitter = require('events').EventEmitter;
var content = fs.readFileSync('index.html');
var configFile = fs.readFileSync('config.json', 'utf8');
@jocafa
jocafa / gist:710558
Created November 22, 2010 19:57
Dependency Stuff
// Defining a dynamically created class that has dependencies
new Kamino.Namespace('Kamino.EmailField', {
Extends: 'Kamino.Field',
Implements: [
Events,
Options,
'Kamino.Validator.Email'
],
[user]
name = Josh Faul
email = josh.faul@gmail.com
[core]
editor = mvim
[branch]
autosetuprebase = remote
@jocafa
jocafa / gist:941167
Created April 25, 2011 20:38
Fancy Strings
- (void)drawRect:(CGRect)rect
{
// Drawing code
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextClearRect(ctx, rect);
[[UIColor darkGrayColor] set];
CGContextFillRect(ctx, rect);
NSMutableAttributedString *attrstr = [[NSMutableAttributedString alloc] initWithString:@"Herp Derp."];