Skip to content

Instantly share code, notes, and snippets.

🤓
Reading your blog posts

Šime Vidas simevidas

🤓
Reading your blog posts
Block or report user

Report or block simevidas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:9302143
"Exception caught during observer callback: @data:text/javascript;base64,CiAgICBQb2x5bWVyKCdwb2x5bWVyLXNlbGVjdG9yJywgewogICAgICAvKioKICAgICAgICogR2V0cyBvciBzZXRzIHRoZSBzZWxlY3RlZCBlbGVtZW50LiAgRGVmYXVsdCB0byB1c2UgdGhlIGluZGV4CiAgICAgICAqIG9mIHRoZSBpdGVtIGVsZW1lbnQuCiAgICAgICAqCiAgICAgICAqIElmIHlvdSB3YW50IGEgc3BlY2lmaWMgYXR0cmlidXRlIHZhbHVlIG9mIHRoZSBlbGVtZW50IHRvIGJlCiAgICAgICAqIHVzZWQgaW5zdGVhZCBvZiBpbmRleCwgc2V0ICJ2YWx1ZWF0dHIiIHRvIHRoYXQgYXR0cmlidXRlIG5hbWUuCiAgICAgICAqCiAgICAgICAqIEV4YW1wbGU6CiAgICAgICAqCiAgICAgICAqICAgICA8cG9seW1lci1zZWxlY3RvciB2YWx1ZWF0dHI9ImxhYmVsIiBzZWxlY3RlZD0iZm9vIj4KICAgICAgICogICAgICAgPGRpdiBsYWJlbD0iZm9vIj48L2Rpdj4KICAgICAgICogICAgICAgPGRpdiBsYWJlbD0iYmFyIj48L2Rpdj4KICAgICAgICogICAgICAgPGRpdiBsYWJlbD0iem90Ij48L2Rpdj4KICAgICAgICogICAgIDwvcG9seW1lci1zZWxlY3Rvcj4KICAgICAgICoKICAgICAgICogSW4gbXVsdGktc2VsZWN0aW9uIHRoaXMgc2hvdWxkIGJlIGFuIGFycmF5IG9mIHZhbHVlcy4KICAgICAgICoKICAgICAgICogRXhhbXBsZToKICAgICAgICoKICAgICAgICogICAgIDxwb2x5bWVyLXNlbGVjdG9yIGlkPSJzZWxlY3RvciIgdmFsdWVhdHRyPSJsYWJ
View transition-flex
// 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
View ECMAScript 6 Promise API
// global constructor
Promise
.all( iterable )
.race( iterable )
.reject( r)
.resolve( x )
.prototype
.catch( onRejected )
.then( onFulfilled, onRejected )
View gist:26cd7ca5bc6e34875b39
// global constructor
Promise
.all( iterable )
.race( iterable )
.reject( r)
.resolve( x )
.prototype
.catch( onRejected )
.then( onFulfilled, onRejected )
@simevidas
simevidas / es6-api
Last active Aug 29, 2015
A terse overview of new ECMAScript 6 API
View es6-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 Jun 19, 2014
requirebin sketch
View index.js
var autoprefixer = require('autoprefixer');
var css = autoprefixer.process('.elem { display: flex }').css;
console.log(css);
@simevidas
simevidas / index.js
Created Jun 19, 2014
requirebin sketch
View index.js
var autoprefixer = require('autoprefixer');
// Quickly testing the API of the Autoprefixer npm package
document.body.textContent = autoprefixer.process('.elem { display: flex }').css;
View gist:34438ea8ad7c1af1a9cc
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}
View gist:cd4c5af291dec41a816f
/*
* 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 Aug 29, 2015
A comparison of the new vs old Screen Orientation API
View gist:70caf9e7196dbb6f07c2
// Old API
screen.orientation
.lockOrientation( orientations )
.unlockOrientation()
screen.addEventListener('orientationchange', handler)
// New API
You can’t perform that action at this time.