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 / 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 / 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 / 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 / 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
:+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;
@Hotell
Hotell / doubleborder.scss
Created March 21, 2012 11:39
SASS:@mixin:doubleborder
@mixin doubleborder($side, $innerColor, $outerColor) {
$shadow: "0 0 0";
border-#{$side}: 1px solid $innerColor;
@if ($side == "top") { $shadow: 0 -1px 0; }
@if ($side == "right") { $shadow: 1px 0 0; }
@if ($side == "bottom") { $shadow: 0 1px 0; }
@if ($side == "left") { $shadow: -1px 0 0; }
-webkit-box-shadow: $shadow $outerColor;
-moz-box-shadow: $shadow $outerColor;
-o-box-shadow: $shadow $outerColor;