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
// 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
var gulp = require('gulp');
// server
var server = require('gulp-express');
var livereload = require('gulp-livereload');
// css
var stylus = require('gulp-stylus');
var autoprefixer = require('gulp-autoprefixer');
var minify = require('gulp-minify-css');
// js
var browserify = require('gulp-browserify');
var $ = jQuery;
// Config = selectors for UL (tabs) and SECTION (panel) elements + which tab should be selected on init
var $list = $('.topbar__tabs');
var $sections = $('.tabbed-section');
var selected_index = 1;
// Caching the LI and A elements since they’ll be heavily used in the code