note: I converted this script into the much easier to install joinopenwifi
module on NPM
see https://github.com/maxogden/joinopenwifi#joinopenwifi for installation instructions
note: I converted this script into the much easier to install joinopenwifi
module on NPM
see https://github.com/maxogden/joinopenwifi#joinopenwifi for installation instructions
describe('catalogyBody', function() { | |
var chai = require('chai'); | |
var path = require('path'); | |
var env = require(path.join(testDir, 'lib', 'environment')); | |
var requirejs = env.requirejs(staticDir); | |
var sinon = requirejs('js/lib/sinon'); | |
var fs = require('fs'); | |
var server; | |
var router; |
var serialport = require('node-serialport') | |
var sp = new serialport.SerialPort("/dev/ttyO3", { | |
parser: serialport.parsers.raw, | |
baud: 9600 | |
}) | |
sp.on('data', function(chunk) { | |
console.log(chunk.toString('hex'), chunk.toString(), chunk) | |
}) |
#!/bin/bash | |
# | |
# Whitelist Pingdom probe-servers in iptables. | |
# | |
# Create a chain called "PINGDOM" and jump to it somewhere before | |
# the final REJECT/DROP, e.g. | |
# | |
# # New chain for Pingdom rules | |
# :PINGDOM - [0:0] | |
# |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.
// Modify as-needed. | |
$.each({ | |
server: 'irc.freenode.net', | |
port: '6667', | |
room: '#grunt', | |
nick: 'gruntly', | |
message_without_join: true, | |
}, function(id, val) { | |
var elem = $('#irc_' + id); | |
if (typeof val === 'boolean') { |
<script src=cordova-2.0.0.js></script> | |
<script src=powermanagement.js></script> | |
<script> | |
document.addEventListener("deviceready", function() { | |
startGeolocating(); | |
cordova.require('cordova/plugin/powermanagement').acquire( | |
function() { console.log( 'hooray power mgmt' ); }, | |
function() { console.log( 'oh no! power mgmt fuct' ); } | |
); | |
}, true); |
require.config({ | |
baseUrl: '/backbone-tests/', | |
paths: { | |
'jquery' : '/app/libs/jquery', | |
'underscore' : '/app/libs/underscore', | |
'backbone' : '/app/libs/backbone', | |
'mocha' : 'libs/mocha', | |
'chai' : 'libs/chai', | |
'chai-jquery' : 'libs/chai-jquery', | |
'models' : '/app/models' |
An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.
Everything is broken up by tag, but within each the selectors aren't particularly ordered.
I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A
A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:
-webkit-appearance:none;
Providing an inter-process communication (IPC) mechanism such that a WebPage can explicitly signal back to PhantomJS as a push, thus eliminating/minimizing the need for users to setup polling functions, etc.
In PhantomJS 1.6, @detro added a WebPage onCallback
handler that could be triggered from a webpage client by invoking the specially attached window.callPhantom
function. However, @ariya expressed some discontent with this approach and so the three of us began discussing utilizing an existing API for cross-domain messaging instead: window.postMessage
. (See Discussion for more info.)
PhantomJS currently only allows for a single handler per signal (a separate problem I'm working on over here). As such, automatically attaching internal handler may prevent users from attaching their own handlers for onInitialized
(tha