Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env node
// =================================================================================
// Copyright (c) 2014 sheutettz. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
#!/usr/bin/env node
// =================================================================================
// Copyright (c) 2014 sheutettz. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
@sheutettz
sheutettz / utilities.js
Created July 26, 2015 03:19
some trivial javascript code snippets.
function inherit(ThisClass, SuperClass) {
var Anon = function () {
};
Anon.prototype = SuperClass.prototype;
ThisClass.prototype = new Anon();
ThisClass.prototype.constructor = ThisClass;
};
function realize(htmlText) {
var div = document.createElement('div');
INCDIR := inc
SRCDIR := src
OBJDIR := obj
#DSTDIR := .
EXENAME := abc.exe
DEBUG := -std=c99 -O3 -Wall -march=pentium -fomit-frame-pointer -fpeephole
#DEBUG += -pedantic
CFLAGS := -DNDEBUG
INCDIR := inc
SRCDIR := src
STUBDIR := test/src
LIBNAME := libxxx.a
EXENAME := xxxt.exe
PREFIX := /opt
#CC := gcc -O3
CC := gcc -g -O0