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
@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,
@Kambfhase
Kambfhase / LICENSE.txt
Created Jul 4, 2011 — forked from 140bytes/LICENSE.txt
activity detection
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
View foo.js
jQuery('main').on('click', '#terminstandorte select option, .nextMonth, .prevMonth', function(){
var request = "openDates";
if (jQuery(this).get(0) == jQuery('.nextMonth').get(0) || jQuery(this).get(0) == jQuery('.prevMonth').get(0)) {
jQuery('#kalender').load('?' + jQuery(this).attr('value') + ' #thisMonth', getFreeDates);
}
function getFreeDates() {
var werk = +jQuery('#terminstandorte select option:selected').attr('value');
var firstDay = jQuery('.calDates .noDate:first').attr('id');
@Kambfhase
Kambfhase / uberspace-letsencrypt.sh
Created Dec 19, 2015
Uberspace Scripts for let's encrypt
View uberspace-letsencrypt.sh
#!/bin/sh -e
########################################################################
#
# 2015-11-24
# Jonas Pasche
# jpasche@jonaspasche.com
#
########################################################################
#
# This program is free software: you can redistribute it and/or modify
View podlove-web-player.js
/*
* ===========================================
* Podlove Web Player v2.0.12
* Licensed under The BSD 2-Clause License
* http://opensource.org/licenses/BSD-2-Clause
* ===========================================
*/
/*jslint browser: true, plusplus: true, unparam: true, vars: true, white: true */
@Kambfhase
Kambfhase / gist:5773165
Last active Dec 18, 2015
This is a simple way to detect critical erros in synchronous code. Not sure if genuis or stupid.
View gist:5773165
function detect( fn, err){
var flag = true;
setTimeout(function(){
if(flag) err();
},0);
fn();
flag = false;
}
// example with error
@Kambfhase
Kambfhase / Option A.js
Created Mar 9, 2013
Design Entscheidung
View Option A.js
var wrapper = $(
'<div class="podlovewebplayer_wrapper">'+
'<div class="podlovewebplayer_meta">'+
'<a class="bigplay" href="#"></a>'+
'<div class="coverart"><img src="samples/coverimage.png" alt=""></div>'+
'<h3 class="episodetitle">'+
'<a href="{URL}">{TITLE}</a>'+
'</h3>'+
'<div class="subtitle">{SUBTITLE}</div>'+
'<div class="togglers">'+
View gist:5014460
$.fn.filterByPattern = function( string){
var regex = new RegExp( string, "ig");
return this.hide().filter(function(){
return regex.test($(this).text());
}).show();
};
$('div').filterByPattern("parents");
View gist:3933113
Minimal testcase:
function(input){
return input;
}
Options:
/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, undef:true, unused:true, browser:true, devel:true, jquery:true, es5:true, indent:4, maxerr:50 */
@Kambfhase
Kambfhase / gist:1175651
Created Aug 27, 2011
JS Class Libs( and Articles)
View gist:1175651
http://code.google.com/p/es-lab/wiki/Traits
http://webreflection.blogspot.com/2010/01/es5-es5-classes-as-descriptor-objects.html
http://javascript.crockford.com/prototypal.html
http://jsclass.jcoglan.com/
http://ejohn.org/blog/simple-javascript-inheritance/
https://github.com/Kambfhase/Din
http://github.com/tobeytailor/def.js
http://mootools.net/docs/core/Class/Class
http://github.com/polvero/klass
http://github.com/Joose/Joose
You can’t perform that action at this time.