Skip to content

Instantly share code, notes, and snippets.

View jonathanmarvens's full-sized avatar

Jonathan Barronville jonathanmarvens

View GitHub Profile
#include <assert.h>
#include <pthread.h>
#include <stdio.h>
void *function(void *argument) {
printf("%s\n", (char *) argument);
return NULL;
}
function createStorage() {
var
_,
map
;
map = new WeakMap();
return (function (object) {
var
function isNumeric(value) {
return ((! isNaN(parseFloat(value))) && isFinite(value));
}
@jonathanmarvens
jonathanmarvens / README-dependency-resolver.md
Last active December 27, 2015 20:19
Simple dependency graph resolver. I needed this for a project, so if it can help someone else too, awesome :) . Of course you'll need to modify it for whatever your nodes' edges may be.

Example use.

var a = new Node("a");
var b = new Node("b");
var c = new Node("c");
var d = new Node("d");
var e = new Node("e");

a.addEdge(b); // a depends on b
function classExtend(subClass, superClass) {
for (var property in superClass) {
if (superClass.hasOwnProperty(property)) {
subClass[property] = superClass[property];
}
}
function constructor() {
this.constructor = subClass;
}

THIS JUST IN: @WebandPHP Embrace Women in an attempt to Enhance PHPness and Boost Subscriptions

< sarcasm >

(PHP) -- A massive sexist storm spanning the globe dumped thousands of foreign messages on unsuspecting geeks as they watched as their tweet stream, normally depicting handy references to JS resources, object oriented design structures and REGEX utilities, turned into a thick sludge of sadness and despair, dividing the community.

Observers agreed, the divide also provided a distinct benefit by making easy work of identifying and arresting misogynist asshats who threaten the very fabric of a community, a community known for communicating using curly brackets, semi-colons and now, with PHP 5.3, namespaces.

Those detained now await no trail, but are able to exercise their right to a quick tagging and permanent display on the Geek Feminist Wiki.

var primeFactorization = function primeFactorization(number, result) {
var result = (result || []);
var root = Math.sqrt(number);
var x = 2;
if (number % x) {
x = 3;
while ((number % x) && ((x = (x + 2)) < root)) {}
}
if (! Function.prototype.bind) {
Function.prototype.bind = function bind(context) {
if (typeof this !== "function") {
throw new TypeError("Function.prototype.bind: the object on which you're trying to bind to is not callable.")
}
var
bound_func,
func,
module DataStructures
class NaiveLinkedList
def initialize()
@head = nil
end
def [](index)
node = @head
self.loop_set_node(index, node)
node.value()