Skip to content

Instantly share code, notes, and snippets.

View Hotell's full-sized avatar
🎯
Focusing

Martin Hochel Hotell

🎯
Focusing
View GitHub Profile
@Hotell
Hotell / defaults-overrides.md
Last active August 26, 2015 09:48 — forked from ericelliott/defaults-overrides.md
ES6 defaults / overrides pattern

ES6 Defaults / Overrides Pattern

Combine default parameters and destructuring for a compact version of the defaults / overrides pattern.

function foo ({
    bar = 'no',
    baz = 'works!'
  } = {}) {
// <script src="angular.min.js"></script>
(function(name, factory) {
// our basic IO module system that stores every module on modules with the "file" namespace
// please use something like browserify rather than rolling your own like this
window.modules = window.modules || {};
window.require = window.require || function require(name) { return window.modules[name] || window[name]; };
var exports = {}; factory(exports, window.require);
window.modules[name] = exports;
}('TodoService', function(exports, require) {
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
@Hotell
Hotell / git.css
Created August 16, 2014 11:20 — forked from neilgee/git.css
/* Set up Git Configuration */
git config --global user.email "neil@coolestguidesontheplanet.com"
git config --global user.name "Neil Gee"
git config --global core.editor "vi"
git config --global color.ui true
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('load-grunt-tasks')(grunt);
//MODIFIED: add require for connect-modewrite
var modRewrite = require('connect-modrewrite');
grunt.initConfig({
@Hotell
Hotell / rAF.js
Created February 3, 2013 20:42 — forked from paulirish/rAF.js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller
// fixes from Paul Irish and Tino Zijdel
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
@Hotell
Hotell / dabblet.css
Created October 9, 2012 20:05 — forked from lensco/dabblet.css
box-shadow vs filter: drop-shadow
/**
* box-shadow vs filter: drop-shadow
*/
body {
background: #ddd;
font: 16px/1 sans-serif;
}
div {
margin: 100px;
@Hotell
Hotell / dabblet.css
Created April 25, 2012 11:46 — forked from kizu/dabblet.css
Scrolling shadows by @kizmarh
/* Scrolling shadows by @kizmarh */
html {
background: #FFF;
}
.scrollbox {
position: relative;
z-index: 1;