Skip to content

Instantly share code, notes, and snippets.

View cramhead's full-sized avatar

Marc d'Entremont cramhead

  • Squamish, BC, Canada
View GitHub Profile
@cramhead
cramhead / .block
Last active June 15, 2017 05:24
treemap example
license: mit
@cramhead
cramhead / .block
Last active June 14, 2017 20:57
Sample chart from Mike's tutorial https://bost.ocks.org/mike/bar/2/
license: mit
@cramhead
cramhead / .block
Last active June 14, 2017 19:37
Sample chart from Mike's tutorial https://bost.ocks.org/mike/bar/2/
license: mit
@cramhead
cramhead / .block
Last active June 14, 2017 16:49
fresh block
license: mit
@cramhead
cramhead / .block
Last active June 14, 2017 21:47
tree example
license: mit
@cramhead
cramhead / .block
Created June 13, 2017 23:09
fresh block
license: mit
@cramhead
cramhead / gist:2a25bbe6d43c75152b99ae0f62d68cf4
Created February 2, 2017 19:18 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@cramhead
cramhead / gist:dc431ab0417fce7aa965
Created July 6, 2014 18:33
Adding and removing collection-hooks in a meteor app
var hookHandles = [];
var initCollectionHooks = function() {
//once the seed process is complete or no seeding takes place add the listener
hookHandles.push(
Collectibles.after.insert(function(userId, doc) {
// get the imageIds and set them as being linked
App.emitter.emit('collectible.added', userId, doc);
})
@cramhead
cramhead / every.js
Created June 13, 2014 19:16
call the function every so many calls
// call the func every count times
var every = function(count, func) {
var self = this,
counter = 0;
return function(arg) {
counter++;
// console.log('counter is ' + counter);
if (counter === count) {
counter = 0;
// console.log("reset counter");
@cramhead
cramhead / assetPath.js
Created January 7, 2014 18:06
get meteor asset path
function getAssetPath() {
var meteor_root = Npm.require('fs').realpathSync(process.cwd() + '/../');
console.log(meteor_root);
var application_root = Npm.require('fs').realpathSync(meteor_root + '/../');
// if running on dev mode
if (Npm.require('path').basename(Npm.require('fs').realpathSync(meteor_root + '/../../../')) == '.meteor') {
application_root = Npm.require('fs').realpathSync(meteor_root + '/../../../../');
}