Very short description of the application.
Applicatoin is written in ruby language, using Ruby on Rails web framework.
| // https://gist.github.com/3069522 | |
| ;(function($, window, document, undefined) { | |
| // Prepare our Variables | |
| var History = window.History; | |
| // Check to see if History.js is enabled for our Browser | |
| if (!History.enabled) { | |
| return false; | |
| } |
Very short description of the application.
Applicatoin is written in ruby language, using Ruby on Rails web framework.
| #!/bin/bash | |
| # Download and watch youtube videos from the shell. | |
| # The Script fetches the url from the clipboard, | |
| # so that you only have to select the url in your | |
| # browser and start the script. Works great when | |
| # mapping "xterm -e youtube.sh" to a shortcut, e.g. Meta-Y. | |
| # requires the tools xclip, youtube-dl and mplayer | |
| # it's probably possible to replace xclip with pbpaste on |
| /* | |
| ... and we enhance the styles for impress.js. | |
| */ | |
| .step { | |
| position: relative; | |
| width: 900px; | |
| padding: 40px; | |
| margin: 20px auto; | |
| -webkit-box-sizing: border-box; |
| function forTimeout(array, iterator, delay) { | |
| void function iteration(index) { | |
| if (index === array.length) return | |
| iterator(array[index]) | |
| setTimeout(function () { iteration(index + 1) }, delay) | |
| }(0) | |
| } | |
| forTimeout([1, 2, 3], function (v) { console.log(v) }, 1000) |
Let's build a JavaScript class syntax from first principles. For the purpose of this exercise, let's assume that the purpose of the class syntax is to add much-needed sugar to common JavaScript idioms.
Let's start with how JavaScript "classes" work today:
// this is a constructor
Person = function() {
this // `this` is a new instance of PersonOver the weekend I implemented a few Array methods in plain JavaScript to avoid recently patched Rhino bugs. That got my thinking about ES5 fallback implementations in various JavaScript libs/frameworks/transpilers. I decided to compile a not-so-complete list of ES5 related discrepancies found in many of them. Differences in native vs. fallback implementations create cross-browser inconsistencies and increase the chance of usage errors. I hope this post will raise awareness of just how hard it is to follow spec (during my research I found a few issues in my own projects too). All library developers should to take a closer look at their code and make the small changes needed to follow the specification (especially if your code forks for native methods).
Most implementations suffer from the following