Skip to content

Instantly share code, notes, and snippets.

View Munter's full-sized avatar

Peter Müller Munter

View GitHub Profile
.ie .app-view {
.app-sidebar__content,
.app-view__content,
.app-wrapper__content {
// The 0px is a hack for IE10. Setting auto will make IE10 set the height of the content rather than the remaining height of the container
@include flex-basis(0px);
}
}
@Munter
Munter / index.html
Created December 8, 2014 10:41
Firefox v34 flexbox auto width bug
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>flexbox firefox v34</title>
<style>
.flexy {
display: flex;
flex-direction: row;
@Munter
Munter / containedIn.js
Created December 15, 2014 17:50
Function check if an object is contained as a subset within another object
function containedIn(subset, set) {
if (typeof subset !== 'object') {
return subset === set;
} else {
return Object.keys(subset).every(function (key) {
return (key in set) && containedIn(subset[key], set[key]);
});
}
}
Guessing --root from input files: file:///home/munter/git/test-sprite/
✔ 0.001 secs: logEvents
✔ 0.001 secs: registerRequireJsConfig
✔ 0.005 secs: registerLabelsAsCustomProtocols
✔ 0.087 secs: loadAssets
✔ 0.008 secs: populate
✔ 0.001 secs: assumeRequireJsConfigHasBeenFound
✔ 0.018 secs: populate
✔ 0.000 secs: fixBaseAssetsOfUnresolvedOutgoingRelationsFromHtmlFragments
✔ 0.001 secs: assumeThatAllHtmlFragmentAssetsWithoutIncomingRelationsAreNotTemplates
@Munter
Munter / fusile-intro.md
Last active August 29, 2015 14:16
Work in progress Fusile description
npm install -g fusile

General usage: fusile <sourceDir> <mountPoint>

Fusile is a compiling file system proxy. In order to get it to compile your assets you need to install one or more of these precompilers: LiveScript, babel, coco, coffee-script, dogescript, less, marked, myth, node-sass, stylus, swig

When any of the above precompilers are available in the context of fusile (in your project root or globally installed), fusile will automatically load it and start compiling files with the corresponding file extension when you read the files from the mountpoint.

.frame-1 { background-image: url(frames/1.png?sprite); }
.frame-2 { background-image: url(frames/2.png?sprite); }
.frame-3 { background-image: url(frames/3.png?sprite); }
.frame-4 { background-image: url(frames/4.png?sprite); }
.frame-5 { background-image: url(frames/5.png?sprite); }
.frame-6 { background-image: url(frames/6.png?sprite); }
.frame-7 { background-image: url(frames/7.png?sprite); }
.frame-8 { background-image: url(frames/8.png?sprite); }
.frame-9 { background-image: url(frames/9.png?sprite); }
/* Different size images based on same source image */
.thing-4x { background-size: 100px; background-image: url(image.svg?inkscape&resize=400); }
.thing-2x { background-size: 100px; background-image: url(image.svg?inkscape&resize=200); }
.thing-1x { background-size: 100px; background-image: url(image.svg?inkscape&resize=100); }
/* Different size images based on same source image, in individual sprite sheets */
.thing-4x { background-size: 100px; background-image: url(image.svg?inkscape&resize=400&sprite=4x); }
.thing-2x { background-size: 100px; background-image: url(image.svg?inkscape&resize=200&sprite=2x); }
.thing-1x { background-size: 100px; background-image: url(image.svg?inkscape&resize=100&sprite=1x); }
@Munter
Munter / mntr.dk.tap
Last active August 29, 2015 14:18
hyperlink tap output
TAP version 13
# Crawling internal assets
ok 1 loading https://mntr.dk/
ok 2 loading https://mntr.dk/favicon.ico
ok 3 loading https://mntr.dk/assets/images/favicon/152.png
ok 4 loading https://mntr.dk/assets/images/favicon/144.png
ok 5 loading https://mntr.dk/assets/images/favicon/120.png
ok 6 loading https://mntr.dk/assets/images/favicon/114.png
ok 7 loading https://mntr.dk/assets/images/favicon/72.png
ok 8 loading https://mntr.dk/assets/images/favicon/57.png
@Munter
Munter / mailtoNewTab.js
Created May 20, 2015 14:08
Always open mailto: links in a new tab. Useful when using webmail clients as mailto: scheme handlers
document.body.addEventListener('focus', function (el) {
if (el.tagName === 'A' && (el.getAttribute('href') || '').indexOf('mailto:') === 0) {
el.setAttribute('target', '_blank');
}
}, false);
function test() {
var rec = Ext.data.Record.create([
{name: 'id', type: 'string'}
]);
var store = new Ext.data.JsonStore({
autoSave: true,
proxy: new Ext.data.HttpProxy({
url: 'test',