Skip to content

Instantly share code, notes, and snippets.

@WebReflection
WebReflection / gist:24c4c475bdeb59405e87
Last active February 15, 2016 15:56
setTimeout and setInterval extra arguments

Every single JavaScript engine supports standard timers *

These accept one or more extra argument by specs

for(var i = 0; i < 2; i++) {
  setTimeout(function (i) {
    console.log(i);
  }, 0, i); // <== see this?
}
@WebReflection
WebReflection / __proto__.js
Last active August 18, 2016 16:41
just __proto__ and all shenanigans it can bring to any environment
// all IE < 11 browsers:
// there is no __proto__
if (!('__proto__' in {})) {
console.log('you gonna have hard time');
// we need extra logic to be able to work
// as meant in IE too. IE9 ain't disappearing
// any time soon in both desktop and mobile
// neither will IE10
}
// all Mobile WebKit browsers:
@airportyh
airportyh / jsconf_slides_codes_and_notes.md
Last active June 19, 2017 20:51
JSConf 2014 Slides, Codes and Notes.

JSConf Slides, Codes and Notes

These are all the JSConf 2014 slides, codes, and notes I was able to cull together from twitter. Thanks to the speakers who posted them and thanks to @chantastic for posting his wonderful notes.

Modular frontend with NPM - Jake Verbaten (@Raynos)

@rwaldron
rwaldron / tdz-1.js
Last active April 4, 2018 21:20
Temporal Dead Zone
{
// The block has begun, we're in a new block scope. The TDZ for the "a" binding has begun
var f = function() {
// 2. Because f() is evaluated before `a` is actually declared,
// an exception will be thrown indicating to the author that
// `a` is not yet defined.
console.log(a);
};
@yorkxin
yorkxin / README.md
Created December 14, 2012 07:45
Notes on Paul Irish's "Things I learned from the jQuery source" casts.

Notes on Paul Irish's "Things I learned from the jQuery source" casts

I watched these videos on 2012/12/14. Today's jQuery version is 1.8.3. So there might be some differences from the original video. I've briefly noted some of the differences between what described in the video and the current stable release. Most code he desribed can be found easily in speed/jquery-basic.js (1.4.2).

Episode 1

2010-06-14 (jQuery 1.4.1)

Strict Mode: The Summary!

Identifiers (variables, functions) cannot be named any of these: "implements", "interface", "let", "package", "private", "protected", "public", "static", and "yield"

OctalLiterals are not allowed.

@getify
getify / gist:7ae82fdc2e86bf66bcba
Last active March 27, 2022 19:50
List of ES6 books either out or in progress...
@nikcorg
nikcorg / berlin-jsconf-2014.md
Last active August 4, 2023 12:45
Slide decks of JSConf 2014
@dypsilon
dypsilon / js-performance-research.md
Created December 10, 2012 17:43
JS Performance Research

Memory Management and Performance

JavaScript engines such as Google’s V8 (Chrome, Node) are specifically designed for the fast execution of large JavaScript applications. As you develop, if you care about memory usage and performance, you should be aware of some of what’s going on in your user’s browser’s JavaScript engine behind the scenes.

Continue reading Writing Fast, Memory-Efficient JavaScript, great general overview of a Google employee

Videos

@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active January 16, 2024 01:17
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {