Skip to content

Instantly share code, notes, and snippets.

Frank Hase Kambfhase

Block or report user

Report or block Kambfhase

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Class.js - A Walktrough.md

This is a Walktrough of Evan Byrne's Class.js ( http://www.evanbyrne.com/article/class.js ). I comment the Code using //!. Please think of this walktrough as a help to avoid these mistakes in the future, not as an insult to the coder.

/*
* Class.js - Providing class structure for javascript
* Licensed under the General Public License (http://www.gnu.org/licenses/gpl.html)
* Copyright 2010 Evan Byrne (http://www.evanbyrne.com/article/class.js)
*/

Class.js, wow, that's creative. Ok, I admit my project names are shitty, too. :(

function Class(obj,args)
View temp m8.js
/*!
* m8 - JavaScript Math Library - v0.2
* by Kambfhase
* released under MIT License
*
* includes vice-versa by Andrea Giammarchi
*/
(function (Object, hasOwnProperty) {
View screening.js
// 1: how could you rewrite the following to make it shorter?
// It can be done in one line, but it gets messy:
bar.[ foo? "doSomething" : "doSomethingElse" ]( el);
// 2: what is the faulty logic in the following code?
View is-this-partial-application.js
// So what I'm doing here seems cool, but I'm not sure exactly what it's called.
// (also, I'm not doing anything smart here with execution context)
function partial( orig_func ) {
var ap = Array.prototype,
partial_args = ap.slice.call( arguments, 1 ),
invoked_args;
function fn() {
var result;
View simple-oop-example.js
$(document).ready( function( ) {
var extendedLogger = function( ) {
//
this.many = ['console', 'alert', 'print'];
//
this.logMultiple = function ( msg ) {
var i=0, many= this.many, n=many.length;
for (; i<n; i++) {
this.logMany( msg, many[i] );
@Kambfhase
Kambfhase / gist:730792
Created Dec 6, 2010
Syntactic saccharin
View gist:730792
// Syntactic saccharin in JavaScript
//
// C-Hackers know that array[i] == *(i+array) == i[array]
// now lets have that in JavaScript, too!
(function(){
var stack=[], str="[[getStack]]";
Object.defineProperty( Number.prototype, str, {
get: function(){
@Kambfhase
Kambfhase / gist:883016
Created Mar 23, 2011
A JavaScript Proxy for Fibonacci numbers.
View gist:883016
// a fibonacci numbers object using proxy.
var fib = Object.create( Proxy.create({
getPropertyDescriptor: function( name){
var index = ~~name;
if( index == name && index > 1){
return {
get: function(){
var val = this[ index-1] + this[ index-2];
Object.defineProperty( this, index, {
value: val,
View gist:948227
C:\dig>dig +trace 2011.jsconf.us
; <<>> DiG 9.3.2 <<>> +trace 2011.jsconf.us
;; global options: printcmd
;; connection timed out; no servers could be reached
C:\dig>dig 2011.jsconf.us
; <<>> DiG 9.3.2 <<>> 2011.jsconf.us
;; global options: printcmd
@Kambfhase
Kambfhase / LICENSE.txt
Created May 23, 2011 — forked from 140bytes/LICENSE.txt
140byt.es -- Ackermann function
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Kambfhase
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@Kambfhase
Kambfhase / LICENSE.txt
Last active Sep 25, 2015 — forked from 140bytes/LICENSE.txt
Brainfuck139
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Kambfhase
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
You can’t perform that action at this time.