- 'Zen' mode, command, shift and \
- PhoneGap development support
// true to 0, false to 1; | |
var tBool = true; | |
var fBool = false | |
tBool^1 // 0 | |
fBool^1 // 1 | |
// true to 1, false to 0; | |
var tBool = true; | |
var fBool = false; |
var BookModel = Model.extend({ | |
length: function () { | |
// take two for contents and index | |
return this.pages.length - 2; | |
} | |
}); | |
var BookController = Controller.extend({ | |
events: { | |
"click .save": "saveBook", |
var api = {}; |
module.exports = indexjs; | |
var fs = require('fs'); | |
var path = require('path'); | |
function indexjs (dirname) { | |
return fs.readdirSync(dirname).reduce(createModuleArray(dirname)); | |
} | |
function createModuleArray (dirname) { |
var Module = null; | |
function JSMESS(canvas, module, game, precallback, callback, scale) { | |
var js_data; | |
var moduledata; | |
var requests = []; | |
var drawloadingtimer; | |
var file_countdown; | |
var spinnerrot = 0; | |
var splashimg = new Image(); |
In this lesson we will learn about using Javascript to interact with hardware. We will be using a platform called Node.js which runs Javascript outside of the browser.
Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It's an open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software for the board. arduino.cc
Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. nodejs.org
var nextButtonHTML = '<button type="button" class="minibutton js-next-issue">Next</button>'; | |
var buttonsContainer = document.querySelector('.gh-header-actions'); | |
var currentURL = window.location.href; | |
var parts = currentURL.split('/'); | |
parts[parts.length - 1]--; // next issue - but going back because usually start at the end | |
var nextURL = parts.join('/'); | |
buttonsContainer.innerHTML += nextButtonHTML; |
var fs = require('fs'); | |
var semver = require('semver'); | |
var numToKeep = process.argv[2] || 2; | |
var files = fs.readdirSync(__dirname).filter(function (file) { | |
return file.indexOf('jsbin-v') === 0; | |
}).sort(function (a, b) { | |
return semver.lt(a.slice(7), b.slice(7)); |
var PlayerController = function PlayerController(opts) { | |
this.model = PlayerModel.create({ | |
blah: 'blah' | |
}); | |
keyCodes.on('keyDown', function (direction) { | |
this[direction](); | |
}, this); // third arg is context of `this` | |
}; | |
PlayerController.prototype = { |