Skip to content

Instantly share code, notes, and snippets.

View nilium's full-sized avatar
🍉
internal screaming intensifies

Noel nilium

🍉
internal screaming intensifies
View GitHub Profile
Rem
Copyright (c) 2009 Noel R. Cower
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
use nuit
use sdl
use sdl_image
use glew
import structs/Stack
import nuit/[GUI, Types, Image, Renderer, FramedWindow, Drawable, NinePatchDrawable]
import sdl
import sdl_image
Baz: class {
}
bazFn: func {}
RBNodeColor: enum {
black = 0
red = 1
}
RBNode: class <K, V> {
color := RBNodeColor black
left, right, parent: This<K, V>
key: K
RBNodeColor: enum {
black = 0
red = 1
}
RBNode: class <K, V> {
@nilium
nilium / gist:440403
Created June 16, 2010 09:51
rock crash log thinger
Process: rock [79573]
Path: /Users/noel/Source/rock/bin/rock
Identifier: rock
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: sh [79572]
Date/Time: 2010-06-16 02:50:17.526 -0700
OS Version: Mac OS X 10.6.3 (10D573)
Report Version: 6
import foo
Bar: class extends Foo {
init: super func
}
Rem
Copyright (c) 2010 Noel R. Cower
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
char *string_replace(const char *haystack, const char *needle, const char *replace) {
char *out_str, *out_ptr; // output string, pointer used for modifying output
int out_len, replace_len; // output length, replacement length
const char *replace_iter, *haystack_iter; // replacement iterater, haystack iterator
const char *needle_iter = NULL; // needle iterator
const char *haystack_last; // last known position in the haystack, used for backtracking
char haystack_val = 0; // last known value in the haystack (used to cut down on derefs)
char needle_val = 0; // current value in the needle search
if (!(haystack && needle && *haystack && *needle)) {
/*
* NSImage+NinePartDrawing.h
*
* Copyright (c) 2011 Noel R. Cower
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*