Skip to content

Instantly share code, notes, and snippets.

@dotmaster
dotmaster / puppet-lesson01
Created March 6, 2014 14:23
puppet-lesson01
user { 'katie':
ensure => 'present',
comment => 'katie',
home => '/home/katie',
shell => '/bin/zsh',
managehome => true
}
//this is a generic function which should be moved to a Baseclass of Backbone or a Backbone extension
autoBind =
{
autoBind: function () {
var self = this;
var funcs = _.functions(this.constructor.prototype);
var protoFuncs = ['autoBind', 'constructor'].concat(
_.functions(Backbone.Collection.prototype),
_.functions(Backbone.Model.prototype));
_.functions(Backbone.View.prototype));
@dotmaster
dotmaster / SHELL SCRIPT.sh
Created March 4, 2011 21:55
Small Guide to use NPM with different versions of node (running N)
git clone git://github.com/isaacs/npm.git ./npm
cd npm
git checkout origin/0.2
make dev
#then make
npm rebuild
@dotmaster
dotmaster / gist:731777
Created December 7, 2010 13:12
CSS vertical centering in all major browsers (including ie6) using less css and conditional comments
.vcenter{
body{
display: table;
.ie6,ie7,ie8,ie9{ //thanks to our conditional comments (see comments below)
position: relative; //for ie
#container{
position:absolute; //for ie
top:50%; //for ie
#page{
position:relative; //for ie
console.log("test")
Sat, 04 Dec 2010 11:16:04 GMT ["test"] 1291461364287
undefined
console.log("test2")
Sat, 04 Dec 2010 11:16:07 GMT ["test2"] 1291461367231
undefined
log.history
Object
1291461364287: Object
arguments: Array[1]
@dotmaster
dotmaster / gist:726802
Created December 3, 2010 10:23
hijacking Javascript console.log revamped with StackTrace (just Google Chrome)
// usage as usual: console.log('inside coolFunc',this,arguments);
if (typeof console !== "undefined") {
console.logJack = console.log;
window.log={}
window.log.history = window.log.history || {}; // store logs to a global history for reference
console.log=function(){
var timestamp= (new Date); //create a timestamp of the log
var millis=timestamp.getTime();
var readableString=timestamp.toUTCString();
@dotmaster
dotmaster / gist:726792
Created December 3, 2010 10:12
hijacking javascript console.log
// usage: log('inside coolFunc',this,arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
log.history = log.history || []; // store logs to an array for reference
log.history.push(arguments);
if(this.console){
console.log( Array.prototype.slice.call(arguments) );
}
};
fsd
sda
@dotmaster
dotmaster / fsd
Created November 22, 2010 09:26
fds
fsd