It seems to require a script for the moment. It disables the launching capability when iTunes is closed, but preserves all other capabilities.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npm install rem | |
var rem = require('rem'); | |
// Create Facebook API, prompting for key/secret. | |
var facebook = rem.load('facebook', 1).prompt(); | |
// Authenticate user via the console. | |
rem.console(facebook, function (err, user) { | |
// Poll new statuses at an interval of 1 second, finding the array | |
// at the 'data' key and checking the 'date' key for date comparison. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npm install rem read clarinet | |
var rem = require('rem'); | |
var read = require('read'); | |
var clarinet = require('clarinet'); | |
// Create Twitter API, prompting for key/secret. | |
var tw = rem.load('twitter', 1.0).prompt(); | |
// Authenticate user via the console. | |
rem.console(tw, function (err, user) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run this first from the console to create an authentication object. | |
var rem = require('rem'); | |
var fs = require('fs'); | |
// Create Google Calendar API, prompting for key/secret. | |
var gdocs = rem.load('google-docs', 3.0, {format: 'xml'}).prompt(); | |
// Authenticate user via the console. | |
rem.console(gdocs, function (err, user) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rem = require('rem'); | |
var read = require('read'); | |
// Prompt and post a tweet from the command line. | |
rem.myConsole('twitter', 1.0, function(err, user) { | |
read({prompt: "Enter a status to tweet: "}, function (err, txt) { | |
user('statuses/update').post({status: txt}, function (err, json) { | |
console.log('Response:', err, json); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generators and "yield" in IcedCoffee | |
# See: https://developer.mozilla.org/en/JavaScript/Guide/Iterators_and_Generators | |
# Try it: http://maxtaco.github.com/coffee-script/ | |
# We can mimick much of the Generator functionality of JavaScript 1.7 | |
# using IcedCoffeeScript's Deferrals. | |
# | |
# We define a "generator" function that can be given a function and return a generator. | |
# To mimick yield, we use a passed argument, "cc", and await/defer on it. This holds on | |
# to the deferral callback until the next time the function is invoked. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h4>API for video element</h1> | |
<pre id="asdf" rows="30" cols="30"></pre> | |
<script> | |
var asdf = document.getElementById('asdf'); | |
var v = document.createElement('video'); | |
var s = document.createElement('span'); | |
for (var k in v) if (!(k in s)) asdf.innerText += k + (typeof v[k] == 'function' ? '()' : '') + '\n'; | |
</script> | |
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EventEmitter | |
listeners: (type) -> | |
if @hasOwnProperty.call (if @_events? then @_events else @_events = {}), type then @_events[type] else @_events[type] = [] | |
on: (args...) -> @addListener args... | |
once: (type, f) -> @on type, g = (args...) -> f.apply(this, args); @removeListener type, g | |
addListener: (type, f) -> | |
if (@listeners(type).push f) > @_maxListeners and @_maxListeners != 0 | |
console?.warn "Possible EventEmitter memory leak detected. #{@_events[type].length} listeners added. Use emitter.setMaxListeners() to increase limit." | |
@emit "newListener", type, f | |
this |
Poll stdin, parse results.