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
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
@simevidas
simevidas / gist:1c47cd54e9287eb376d5
Created February 24, 2015 15:34
ARIA tabs fork used on WPD (snapshot)
var $ = jQuery;
var $list = $('.topbar__tabs');
var $sections = $('.tabbed-section');
var selected_index = 0;
var $items = $list.children('li');
var $anchors = $list.find('a');
// The setup
default-src
'self'
;
script-src
'self'
https://a.disquscdn.com/
https://hashtagsecurity.disqus.com
code.jquery.com
;
img-src
@simevidas
simevidas / gist:b8625d9a91ac5160d503
Created March 7, 2015 04:02
The current Shumway SWF whitelist
http://g-ecx.images-amazon.com/*/AiryBasicRenderer*.swf
http://z-ecx.images-amazon.com/*/AiryFlashlsRenderer._TTW_.swf
http://ia.media-imdb.com/*/AiryFlashlsRenderer._TTW_.swf
@simevidas
simevidas / gist:74a1d8a85fefe2cc74bc
Last active August 29, 2015 14:19
Logging CSS will-change usage on live sites
// Paste this into the browser’s JavaScript console
function walkTheDOM(node, func) {
func(node);
node = node.firstChild;
while (node) {
walkTheDOM(node, func);
node = node.nextSibling;
}
}
@simevidas
simevidas / es6-numbers-summary.md
Last active September 21, 2015 17:30
A summary of Nicolas Bevacqua’s post on ES6 Number improvements

ES6 Number improvements

  • use the 0b prefix for binary, and the 0o prefix for octal integer literals
  • Number.isNaN and Number.isFinite are like their global namesakes, except that they don’t coerce the argument to Number
  • Number.parseInt and Number.parseFloat are exactly the same as their global namesakes
  • use Number.isInteger to check if the argument is a Number value that doesn’t have a decimal part
  • use Number.EPSILON to check if the difference between two Number values is negligible (e.g. the difference between 0.1 + 0.2 and 0.3 is negligible)
  • Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER are the largest and smallest integers that can be safely and precisely represented in JavaScript
  • use Number.isSafeInteger to check if an integer is within those bounds

Articles about flexbox:

<head>
<script>document.write('<meta charset="utf-8">')</script>
</head>
<body>
<script>
document.body.innerHTML += "✓";
</script>
</body>
@simevidas
simevidas / gist:6612409
Last active December 23, 2015 09:09
Poll: Code blocks in blog posts