Skip to content

Instantly share code, notes, and snippets.

function inherits(ctor, base) {
ctor.prototype = Object.create(base);
ctor.prototype.constructor = ctor
return ctor
}
function extend(tgt) { var sources
sources = Array.prototype.slice.call(arguments, 1)
sources.forEach(function(source){
Object.keys(source).forEach(function(key){
tgt[key] = source[key] })})
@Wizek
Wizek / object-watch.js
Created December 28, 2011 13:39 — forked from eligrey/object-watch.js
object.watch polyfill
// Cross-browser object.watch and object.unwatch
// object.watch
if (!Object.prototype.watch) {
Object.prototype.watch = function (prop, handler) {
var oldval = this[prop], newval = oldval,
getter = function () {
return newval;
},
setter = function (val) {
foo
(
function( ) {
return bar(
'foo' ) ;
},
function
()
{
return 'bar'
@Wizek
Wizek / my-story.lisp
Last active December 13, 2015 20:48
(data "title" "My Story")
(data "author" "Mortchek")
(start-page "foo")
(page "foo"
(text "You are in a place.\n")
(choice (go "bar") "Do a thing!\n")
(choice (go "baz") "Do a different thing!\n")
(choice (give "sword") "Pick up a sword!\n")
(choice (give "shield") "Pick up a shield!\n")
"require github://jquery/jquery/src/intro.js"
"require github://jquery/jquery/src/core.js"
"require github://jquery/jquery/src/callbacks.js"
"require github://jquery/jquery/src/deferred.js"
"require github://jquery/jquery/src/support.js"
"require github://jquery/jquery/src/data.js"
"require github://jquery/jquery/src/queue.js"
"require github://jquery/jquery/src/attributes.js"
"require github://jquery/jquery/src/event.js"
@Wizek
Wizek / logFactory.js
Created September 18, 2013 12:48 — forked from Wizek/logFactory.js
// Superpowered logging for AngularJS.
angular.module('logFactory', ['ng'])
.value('logFactory_whiteList', /.*/)
//.value('logFactory_whiteList', /!|.*Ctrl|run/)
.value('logFactory_piercingMethods', {warn:true, error:true})
.factory('logFactory', ['$log', 'logFactory_whiteList' , 'logFactory_piercingMethods', function ($log, whiteList, piercing) {
piercing = piercing || {}
"require github://Wizek/jquery/src/intro.js"
"require github://Wizek/jquery/src/core.js"
"require github://Wizek/jquery/src/callbacks.js"
"require github://Wizek/jquery/src/deferred.js"
"require github://Wizek/jquery/src/support.js"
"require github://Wizek/jquery/src/data.js"
"require github://Wizek/jquery/src/queue.js"
"require github://Wizek/jquery/src/attributes.js"
"require github://Wizek/jquery/src/event.js"
MainCtrl = ($scope) ->
$scope.list = [4,2,1,11]
$scope.set = {a:1,b:1,c:1}
$scope.fn = (x) -> console.log(x);x
git show HEAD --stat=200 | tail +7 | awk '{ print $3 " "$4 " " $1}' | sort -n -r | less
@Wizek
Wizek / deptree.py
Last active August 29, 2015 14:26 — forked from aszlig/deptree.py
Generate GraphViz dependency tree of a TaskWarrior task.
#!/usr/bin/env python
import sys
from subprocess import Popen, PIPE
from json import loads
class Task(object):
def __init__(self, data):
self.data = data