Skip to content

Instantly share code, notes, and snippets.

View cobbdb's full-sized avatar

Dan cobbdb

View GitHub Profile
@cobbdb
cobbdb / hook.php
Created February 18, 2017 09:00
Github webhook quick example
<?php
function writeLog($msg) {
$fout = fopen('log.txt', 'w');
fwrite($fout, $msg);
fclose($fout);
}
$headers = getallheaders();
if (array_key_exists('X-Github-Event', $headers)) {
@cobbdb
cobbdb / gist:bcab1dd94ac945dc4741
Created November 5, 2014 23:23
BaseClass interface notes
var BaseClass = require('baseclassjs');
return BaseClass({
speak: BaseClass.Abstract
});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var Pet = requre('./pet.js'),
Carnivor = require('./carnivor.js'),
Friendly = require('./friendly.js');
return Pet().extend({
speak: function () {
@cobbdb
cobbdb / BaseClass.js
Last active August 29, 2015 14:07
Notes for dirt simple JS inheritance
function BaseClass(child) {
var key;
child = child || {};
this.base = {};
for (key in this) {
this.base[key] = this[key];
}
for (key in child) {
this[key] = child[key];
}