Skip to content

Instantly share code, notes, and snippets.

View simevidas's full-sized avatar
🦊
sticking with Firefox till the end

Šime Vidas simevidas

🦊
sticking with Firefox till the end
View GitHub Profile
"Exception caught during observer callback: @data:text/javascript;base64,CiAgICBQb2x5bWVyKCdwb2x5bWVyLXNlbGVjdG9yJywgewogICAgICAvKioKICAgICAgICogR2V0cyBvciBzZXRzIHRoZSBzZWxlY3RlZCBlbGVtZW50LiAgRGVmYXVsdCB0byB1c2UgdGhlIGluZGV4CiAgICAgICAqIG9mIHRoZSBpdGVtIGVsZW1lbnQuCiAgICAgICAqCiAgICAgICAqIElmIHlvdSB3YW50IGEgc3BlY2lmaWMgYXR0cmlidXRlIHZhbHVlIG9mIHRoZSBlbGVtZW50IHRvIGJlCiAgICAgICAqIHVzZWQgaW5zdGVhZCBvZiBpbmRleCwgc2V0ICJ2YWx1ZWF0dHIiIHRvIHRoYXQgYXR0cmlidXRlIG5hbWUuCiAgICAgICAqCiAgICAgICAqIEV4YW1wbGU6CiAgICAgICAqCiAgICAgICAqICAgICA8cG9seW1lci1zZWxlY3RvciB2YWx1ZWF0dHI9ImxhYmVsIiBzZWxlY3RlZD0iZm9vIj4KICAgICAgICogICAgICAgPGRpdiBsYWJlbD0iZm9vIj48L2Rpdj4KICAgICAgICogICAgICAgPGRpdiBsYWJlbD0iYmFyIj48L2Rpdj4KICAgICAgICogICAgICAgPGRpdiBsYWJlbD0iem90Ij48L2Rpdj4KICAgICAgICogICAgIDwvcG9seW1lci1zZWxlY3Rvcj4KICAgICAgICoKICAgICAgICogSW4gbXVsdGktc2VsZWN0aW9uIHRoaXMgc2hvdWxkIGJlIGFuIGFycmF5IG9mIHZhbHVlcy4KICAgICAgICoKICAgICAgICogRXhhbXBsZToKICAgICAgICoKICAgICAgICogICAgIDxwb2x5bWVyLXNlbGVjdG9yIGlkPSJzZWxlY3RvciIgdmFsdWVhdHRyPSJsYWJ
// Hey! Listen!
// The above slide animation is transition:flex.
// No hard-coded px/% width values!
@media (min-width: 800px)
.services
display flex
.services__item
flex 1
transition flex .25s ease-in-out .1s
// global constructor
Promise
.all( iterable )
.race( iterable )
.reject( r)
.resolve( x )
.prototype
.catch( onRejected )
.then( onFulfilled, onRejected )
@simevidas
simevidas / gist:26cd7ca5bc6e34875b39
Created June 7, 2014 11:21
New ECMAScript 6 API
// global constructor
Promise
.all( iterable )
.race( iterable )
.reject( r)
.resolve( x )
.prototype
.catch( onRejected )
.then( onFulfilled, onRejected )
@simevidas
simevidas / es6-api
Last active August 29, 2015 14:02
A terse overview of new ECMAScript 6 API
// http://people.mozilla.org/~jorendorff/es6-draft.html
Promise
.all( iterable )
.race( iterable )
.reject( r )
.resolve( x )
.prototype
.catch( onRejected )
.then( onFulfilled, onRejected )
@simevidas
simevidas / index.js
Created June 19, 2014 19:25
requirebin sketch
var autoprefixer = require('autoprefixer');
var css = autoprefixer.process('.elem { display: flex }').css;
console.log(css);
@simevidas
simevidas / index.js
Created June 19, 2014 23:58
requirebin sketch
var autoprefixer = require('autoprefixer');
// Quickly testing the API of the Autoprefixer npm package
document.body.textContent = autoprefixer.process('.elem { display: flex }').css;
body{cursor:default}li,p,ul{margin:0;padding:0}table{border-spacing:0;border-collapse:collapse;margin-top:1em;white-space:nowrap}td,th{border:1px solid #bbb;padding:.5em}#head-bar{overflow:auto}#menu{float:left;padding-left:.6em}#menu li{display:inline}#menu li:not(:last-child)::after{content:" | "}#menu li.selected{font-weight:700}#log-count{float:right;padding:0 .2em;color:red;font-weight:700}#content li{display:none}#dropzone{height:100px;background-color:#eee}#payments{display:none}#allData{position:relative}.inactive{background-color:#fee}.active{background-color:#efe}#metadata{position:absolute;top:0;right:0}#log{display:none;position:fixed;bottom:0;height:20em;left:0;right:0;padding:.2em;overflow-y:scroll;background-color:#000;color:#fff;font-size:12px;font-family:Consolas,monospace}#log p{margin:.2em}
@simevidas
simevidas / gist:cd4c5af291dec41a816f
Last active August 29, 2015 14:03
color parsing API
/*
* Tab Atkins's color parsing API proposal
* Source: http://www.w3.org/blog/CSS/2014/07/10/minutes-telecon-219/
*/
var color;
// creating color objects from RGBA components
color = RGBAColor(50, 100, 150, .5);
color = RGBAColor({ r: 50, g: 100, b: 150, a: .5 });
@simevidas
simevidas / gist:70caf9e7196dbb6f07c2
Last active August 29, 2015 14:08
A comparison of the new vs old Screen Orientation API
// Old API
screen.orientation
.lockOrientation( orientations )
.unlockOrientation()
screen.addEventListener('orientationchange', handler)
// New API