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 / git.css
Created August 16, 2014 11:20 — forked from neilgee/git.css
/* Set up Git Configuration */
git config --global user.email "[email protected]"
git config --global user.name "Neil Gee"
git config --global core.editor "vi"
git config --global color.ui true
@Hotell
Hotell / ng.resourceCustomDef.ts
Last active August 29, 2015 14:06
Custom ng.resource definition
// We have the option to define arguments for a custom resource
interface IArticleParameters {
id: number;
}
interface IArticleResource extends ng.resource.IResource<IArticleResource> {
title: string;
text: string;
date: Date;
author: number;
@Hotell
Hotell / ws.bug.ts
Last active August 29, 2015 14:06
Webstorm type infer bug
declare module ng{
interface IAngularStatic{
}
interface IPromise<T> {
then<TResult>(successCallback: (promiseValue: T) => IPromise<TResult>, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise<TResult>;
then<TResult>(successCallback: (promiseValue: T) => TResult, errorCallback?: (reason: any) => TResult, notifyCallback?: (state: any) => any): IPromise<TResult>;
}
@Hotell
Hotell / index.html
Created September 16, 2014 18:39
The Holy Grail of CSS Centering
<body>
<div class="container">
<!-- Centered inside whatever sized container -->
<div class="outer">
<div class="inner">
<div class="centered">
<p>
@Hotell
Hotell / dom.js
Last active August 29, 2015 14:06
var dom = (function(window) {
'use strict';
var docElem = window.document.documentElement;
function getViewportSize() {
return {
w: Math.max(document.documentElement.clientWidth, window.innerWidth || 0),
h: Math.max(document.documentElement.clientHeight, window.innerHeight || 0)
@Hotell
Hotell / subclass.js
Created September 29, 2014 08:41
js inheritance
// Person super class
function Person(name) {
this.name = name;
}
Person.prototype.describe = function () {
return 'Person called '+this.name;
};
// Employee sub class
function Employee(name, title) {
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 / triggerHandler.js
Last active November 9, 2015 12:22
jqLite#triggerHandler
// jqLite triggerHandler api
// dummy controller
function Ctrl(){
this.clickMeBro = function(){
};
this.enterMeYo = function(event){
// <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) {