Skip to content

Instantly share code, notes, and snippets.

View micha149's full-sized avatar

Michael van Engelshoven micha149

  • Brainbits GmbH
  • Sankt Augustin, Germany
View GitHub Profile
{
"vars": {
"@gray-darker": "lighten(#000, 13.5%)",
"@gray-dark": "lighten(#000, 20%)",
"@gray": "lighten(#000, 33.5%)",
"@gray-light": "lighten(#000, 60%)",
"@gray-lighter": "lighten(#000, 93.5%)",
"@brand-primary": "#0092dd",
"@brand-success": "#5cb85c",
"@brand-info": "#5bc0de",
@micha149
micha149 / _main.scss
Last active August 29, 2015 14:15
Exclude Mobile CSS into separate stylesheet
@import "mixins";
body {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.container {
width: 960px;
margin: 0 auto;
@micha149
micha149 / example.js
Created August 31, 2015 08:19
Javascript Promises + ES6 arrow functions = ♥
return repo.getHeadCommit()
.then(commit => commit.getTree())
.then(tree => tree.getEntry('bla/foo/bar'))
.then(entry => entry.getTree())
.then(tree => makeThings(repo, tree))
@micha149
micha149 / yqllocalstoragecache.html
Created October 19, 2010 20:04 — forked from codepo8/yqllocalstoragecache.html
YQL and local storage
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.8.0/build/reset-fonts-grids/reset-fonts-grids.css&2.8.0/build/base/base-min.css">
</head>
<body class="yui-skin-sam">
<div id="doc" class="yui-t7">
@micha149
micha149 / gist:838423
Created February 22, 2011 09:42
Adding classes to first and last columns via jQuery
for (var i = 0; i < teaserData.length; i++) {
// Create teaser markup
var teaser = $('<div/>').addClass('teaser');
// ...
// Constructing the teaser
// ...
teaser.appendTo(container);
@micha149
micha149 / gist:850628
Created March 2, 2011 07:56
Get diagonal animation steps for a grid (qunit tested)
module("Diagonale");
var getStep = function(index, cols) {
if (index <= cols) {
return index;
}
return index % cols === 0
? index / cols + (cols - 1)
@micha149
micha149 / gist:1111650
Created July 28, 2011 14:33
Grouping every 5 elements with jQuery
var childs = $('div.wrapper > div');
childs.filter(':nth-child(5n+1)').each(function(){
$(this).nextAll(':lt(4)')
.andSelf()
.wrapAll('<div/>');
});
@micha149
micha149 / gist:1130271
Created August 7, 2011 10:15
3d text mixin for sass
@mixin text-3d ($color, $distance: 5px, $angle: 45deg) {
$value: "";
@for $i from 0px through $distance {
$horizontal: (1px - $i) (1px + $i) $color;
$vertical: (-1px - $i) (-1px + $i) darken($color, 20%);
@if $i > 0 {
@micha149
micha149 / gist:1729738
Created February 3, 2012 11:23
Teaser Cache Callback
<?php
/**
* Adds additional data to teaser cache
*
*
* Each Teaser will now contain the following:
* array(3) {
* [name] =>
* string(7) "Michael"
@micha149
micha149 / blend-timer.js
Last active October 3, 2015 01:08
Usage prototype for home-js a nodeJS based toolkit for KNX home automation
var latitude = 50.78,
longtitude = 7.15,
timer = new BlendsTimer(address, connection);
up = new RandomTimeOffset({
time: new DayTimeSunrise(latitude, longtitude),
min: "+30m",
max: "+1h"
});