(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.
virtual_class = (classes...)-> | |
classes.reduceRight (Parent, Child)-> | |
class Child_Projection extends Parent | |
constructor: -> | |
# Temporary replace Child.__super__ and call original `constructor` | |
child_super = Child.__super__ | |
Child.__super__ = Child_Projection.__super__ | |
Child.apply @, arguments | |
Child.__super__ = child_super |
(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.
module.exports = function (grunt) { | |
// show elapsed time at the end | |
require('time-grunt')(grunt); | |
// load all grunt tasks | |
require('load-grunt-tasks')(grunt); | |
//MODIFIED: add require for connect-modewrite | |
var modRewrite = require('connect-modrewrite'); | |
grunt.initConfig({ |
// Pre-requisites: | |
// 1. Device core plugin | |
// 2. Splashscreen core plugin (3.1.0) | |
// 3. config.xml: <preference name="AutoHideSplashScreen" value="false" /> | |
// 4. config.xml: <preference name="DisallowOverscroll" value="true" /> | |
function onDeviceReady() { | |
if (parseFloat(window.device.version) >= 7.0) { | |
document.body.style.marginTop = "20px"; | |
// OR do whatever layout you need here, to expand a navigation bar etc |
ProcessDocument = app.trustedFunction(function () { | |
app.beginPriv(); | |
var newDoc = app.newDoc(); | |
var p = app.response("Start with page(default 0 - process all pages)?", "Query", "0"); | |
var startFrom = parseInt(p) || 0; | |
var i = 0; | |
while (i < this.numPages) { | |
newDoc.insertPages({ | |
nPage: newDoc.numPages - 1, |
<?php | |
/* LangRouter | |
* ========== | |
* | |
* This plugin is meant to be used with Babel extra for MODX Revolution. It | |
* takes care of switching contexts, which hold translations, depending on URL | |
* requested by client. LangRouter works with so called subfolder based setup, | |
* in which many languages are served under a single domain but are | |
* differentiated by a virtual subfolder indicating the language, eg. | |
* mydomain.com/pl/. |
var m = new Backbone.Model();
This is a convention to compensate for JavaScript's lack of private properties on objects. Being able to identify private methods is important because it tells us that we don't need to test those methods and that they will not be coupled to anything outside of the object.
#!/bin/bash | |
# | |
# This is a Mac OSX shell script, you can simply double-click to start it. | |
# | |
# This is where you downloaded the AIR SDK from http://labs.adobe.com/downloads/air3-3.html | |
AIR_SDK="/Applications/Adobe/AIR SDK/AIR SDK 3.3b3" | |
# iOS 5.0 |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-s | |
RewriteRule ^(.*)$ rest/index.php?_rest=$1 [QSA,NC,L] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^(.*)$ rest/index.php [QSA,NC,L] | |
</IfModule> |
// Tests whether an html entity is allowed in .innerHTML assignment for xhtml documents. | |
// entities scraped from http://www.webstandards.org/learn/reference/charts/entities/ | |
// stack overflow question on this issue http://stackoverflow.com/questions/4162270/why-does-this-simple-innerhtml-assignment-throw-an-exception/ | |
// In my testing, in Webkit and Mozilla, only ", &, < and > work. | |
var markupEntities = [""", "&", "<", ">", "Œ", "œ", "Š", "š", "Ÿ", "ˆ", "˜", " ", " ", " ", "‌", "‍", "‎", "‏", "–", "—", "‘", "’", "‚", "“", "”", "„", "†", "‡", "‰", "‹", "›", "€"]; | |
var iso8859_1Entities = [" ", "¢", "£", "¤", "¥", "¦", "§", "¨", "©", "ª", "«", "¬", "­", "®", "¯", "°", "±", "²", "³", "´", "µ", "¶", "·" |