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
// An example of how to use the PhoneGap / Cordova plugin described in this post [[ http://blog.evantahler.com/phonegap-and-push-notifications ]] to get an iOs device token | |
document.addEventListener("deviceready", function(){ | |
getDeviceToken(); | |
} | |
getDeviceToken = function(){ | |
if(typeof device != "undefined" && typeof cordova == "object"){ | |
var getToken = function(types, success, fail){ | |
cordova.exec(success, fail, "PushToken", "getToken", types); |
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 domain = require('domain'); | |
var should = require('should'); | |
////////////// | |
// Function // | |
////////////// | |
var add = function(a,b,callback){ | |
if(!isNumber(a)) { throw new Error(a + "is not a number"); } | |
if(!isNumber(b)) { throw new Error(b + "is not a number"); } |
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 domain = require('domain'); | |
var redis = require('redis'); | |
var eventEmitter = require('events').EventEmitter; | |
var tests = []; | |
var testCounter = 0; | |
var runTest = function(){ | |
if(tests.length > testCounter){ | |
tests[testCounter](); | |
}else{ |
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 oauth = require('oauth'); | |
var consumerKey = "AAAAAAAAAAAAAAAAAA"; | |
var consumerSecret = "BBBBBBBBBBBBBBBBBBBB"; | |
var callbackURL = "http://127.0.0.1:8080/twitterOauthCatch"; // be sure to set me in the application's settings on dev.twitter.com | |
var oathClient = new oauth.OAuth( | |
"https://twitter.com/oauth/request_token", | |
"https://twitter.com/oauth/access_token", | |
consumerKey, | |
consumerSecret, |
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 action = {}; | |
///////////////////////////////////////////////////////////////////// | |
// metadata | |
action.name = "inspectTasks"; | |
action.description = "I show you what it going on"; | |
action.inputs = { | |
"required" : [], | |
"optional" : [] | |
}; |
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
nfo: Creating snapshot 4.3.1-7 | |
info Uploading: [=============================] 100% | |
info: Updating app actionHero | |
info: Activating snapshot 4.3.1-7 for actionHero | |
info: Starting app actionHero | |
error: Error running command deploy | |
error: Nodejitsu Error (500): Internal Server Error | |
error: There was an error while attempting to deploy the app | |
error: | |
error: package.json error: can't find starting script: node ./bin/actionHero start |
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
def sleeper | |
i = 0 | |
while i < 10 | |
puts "sleeping... #{i}" | |
blocking_sleep 1 | |
i = i + 1 | |
end | |
return i | |
end |
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
// myObject.js | |
(function(exports){ | |
var myObject = { | |
thing: 'stuff' | |
}; | |
exports.myObject = myObject; | |
})(typeof exports === 'undefined' ? window : exports); |
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
{ | |
// make it pretty | |
"theme": "Flatland Dark.sublime-theme", | |
"color_scheme": "Packages/Theme - Flatland/Flatland Dark.tmTheme", | |
"font_size": 12.5, | |
// tabs | |
"tab_size": 2, | |
"translate_tabs_to_spaces": true, |
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
exports.action = { | |
name: "fileResponder", | |
description: "fileResponder", | |
outputExample: {}, | |
inputs: { required: [], optional: [] }, | |
run: function(api, connection, next){ | |
var server = api.servers.servers[connection.type]; | |
try{ | |
// the hard-coded file you want to send, relitive to site's root | |
connection.params.file = "index.html" |