(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /*! | |
| * $.preload() function for jQuery – http://mths.be/preload | |
| * Preload images, CSS and JavaScript files without executing them | |
| * Script by Stoyan Stefanov – http://www.phpied.com/preload-cssjavascript-without-execution/ | |
| * Slightly rewritten by Mathias Bynens – http://mathiasbynens.be/ | |
| * Note that since this script relies on jQuery, the preloading process will not start until jQuery has finished loading. | |
| */ | |
| jQuery.preload = function(array) { | |
| var length = array.length, |
| /** | |
| * Annoying.js - How to be an asshole to your users | |
| * | |
| * DO NOT EVER, EVER USE THIS. | |
| * | |
| * Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com) | |
| * Visit https://gist.github.com/767982 for more information and changelogs. | |
| * Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog | |
| * Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors | |
| * |
| package dsl | |
| import java.util.Calendar | |
| object Data { | |
| class Dia(val dia:Int) { | |
| def de(mes:Mes) = { | |
| new ConectorParaAno(dia, mes) | |
| } |
| <!DOCTYPE html> | |
| <head> | |
| <title>Stay Standalone</title> | |
| <meta name="apple-mobile-web-app-capable" content="yes"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | |
| <script src="stay_standalone.js" type="text/javascript"></script> | |
| </head> | |
| <body> | |
| <ul> | |
| <li><a href="http://google.com/">Remote Link (Google)</a></li> |
| var isThrottled = false, | |
| throttleDuration = 24; // ms | |
| function thingToThrottle() { | |
| if (isThrottled) { return; } | |
| isThrottled = true; | |
| setTimeout(function () { isThrottled = false; }, throttleDuration); | |
| // do your work here | |
| } |
| @media (min--moz-device-pixel-ratio: 1.5), | |
| (-o-min-device-pixel-ratio: 3/2), | |
| (-webkit-min-device-pixel-ratio: 1.5), | |
| (min-device-pixel-ratio: 1.5), | |
| (min-resolution: 144dpi), | |
| (min-resolution: 1.5dppx) { | |
| /* Retina rules! */ | |
| } |
| function Foo(who) { | |
| this.me = who; | |
| } | |
| Foo.prototype.identify = function() { | |
| return "I am " + this.me; | |
| }; | |
| function Bar(who) { | |
| Foo.call(this,"Bar:" + who); |
| /** | |
| * Retrieves all the rows in the active spreadsheet that contain data and logs the | |
| * values for each row. | |
| * For more information on using the Spreadsheet API, see | |
| * https://developers.google.com/apps-script/service_spreadsheet | |
| */ | |
| function readRows() { | |
| var sheet = SpreadsheetApp.getActiveSheet(); | |
| var rows = sheet.getDataRange(); | |
| var numRows = rows.getNumRows(); |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // Get the active Media Query as defined in the CSS | |
| // Use the following format: | |
| // #getActiveMQ-watcher { font-family: "default"; } | |
| // @media only screen and (min-width:20em){ #getActiveMQ-watcher { font-family: "small"; } } | |
| // etc. | |
| window.getActiveMQ = function() { | |
| // Build the watcher | |
| var $watcher = document.createElement('div'), | |
| // alias getComputedStyle | |
| computed = window.getComputedStyle, |