Skip to content

Instantly share code, notes, and snippets.

@smonn
smonn / domready.js
Created May 30, 2012 19:57
My DOM Ready function
/*jslint indent: 2 */
(function (global) {
'use strict';
var domready = function (callback) {
if (typeof callback !== 'function') {
throw new TypeError('callback is not a function');
}
function loaded() {
callback();
}
@smonn
smonn / pointer.c
Created January 30, 2012 19:09
C pointer sample
#include <stdio.h>
void foo1(int * bar) {
// bar is now set to 2 outside this function
// scanf works in a similar way
// * dereferences bar, without it we would try to assign 2 to a pointer
*bar = 2;
}
void foo2(int bar) {
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <assert.h>
#include <limits.h>
static unsigned int graph[21][21] = {{0}};