Skip to content

Instantly share code, notes, and snippets.

View bxt's full-sized avatar

Bernhard Häussner bxt

View GitHub Profile
@bxt
bxt / .block
Created July 28, 2017 08:54 — forked from mbostock/.block
Collision Detection
license: gpl-3.0
@bxt
bxt / start-urxvt.sh
Last active September 22, 2015 10:22 — forked from anonymous/start-urxvt.sh
Starting urxvt with nice colors, size and position
urxvt -depth 32 -bg rgba:ff00/f900/db00/dddd -bd rgba:ff00/f800/d000/dddd -fg rgba:0000/0000/0000/eeee -sr -scrollstyle plain -geometry 140x37+$[ 50 + $[ RANDOM % 100 ]]+$[ 500 + $[ RANDOM % 200 ]]
# A class-based template for jQuery plugins in Coffeescript
#
# $('.target').myPlugin({ paramA: 'not-foo' });
# $('.target').myPlugin('myMethod', 'Hello, world');
#
# Check out Alan Hogan's original jQuery plugin template:
# https://github.com/alanhogan/Coffeescript-jQuery-Plugin-Template
#
do ($=jQuery) ->
@bxt
bxt / once.js
Created September 8, 2012 08:38
JavaScript の once よくつかうので (I actually don't use it that often)
function once (fn) {
var done = false, result;
function _once_ () {
if(!done) {
result = fn.apply(this,Array.prototype.slice.call(arguments))
done = true;
}
return result;
}
return _once_;
@bxt
bxt / Profile.php
Created February 27, 2011 20:29 — forked from supernifty/profile.php
Ultra Simple PHP Profiler writing CSV files (OOP verision)
<?php
/**
* A simple class for tracking execution times of PHP scripts and logging them into CVS files
* @author Bernhard Häussner
* @see https://gist.github.com/846504
*/
class Profile {
private $_start = array();
private $_subdata = '';