This file contains hidden or 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
(function(glob) { | |
/* | |
stpl | |
Morgan "ARR!" Allen | |
[email protected] | |
supports simple replacements | |
<li>${var}</li> + { var: "val" } = <li>val</li> | |
simple replacement with default value |
This file contains hidden or 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
(function(global) { | |
var config = false, | |
modules = []; | |
// setup single public namespace | |
var skel = global.skel = { | |
init: function(c) { | |
// put initial config in the public scope | |
config = c; |
This file contains hidden or 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
/* | |
XChng v0.1 | |
Morgan "ARR!" Allen <[email protected]> | |
</[email protected]> | |
MIT License | |
usage: node xchng.node.js [ value || 1 ] | |
*/ | |
var http = require("http"), |
This file contains hidden or 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 gist = "just a test, update"; |
This file contains hidden or 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 gist = "just a test,2"; |
This file contains hidden or 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
<html> | |
<head> | |
<script type="text/javascript" src="zeroth.js"></script> | |
</head> | |
<body> | |
<script> | |
console.log("First script"); | |
</script> | |
<script> | |
var s = document.createElement("script"); |
This file contains hidden or 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 jsdom = require("jsdom"), | |
fs = require("fs"); | |
fs.readFile("test.html", function(err, content) { | |
if(err) throw err; | |
var doc = jsdom.jsdom(content, jsdom.defaultLevel); | |
doc.addEventListener("load", function() { | |
console.log(arguments); |
This file contains hidden or 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
function RGB2HEX(s) { | |
return [ parseInt(s.substr(0,2), 16), parseInt(s.substr(2,2), 16), parseInt(s.substr(4,2), 16) ]; | |
} | |
function ItoS(i) { | |
return i === 0 ? "00" : i.toString(16); | |
} | |
function HEX2RGB(s) { | |
return ItoS(s[0]) + ItoS(s[1]) + ItoS(s[2]); |
This file contains hidden or 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
info: Welcome to Nodejitsu nko3-derpatron | |
info: jitsu v0.10.5, node v0.8.2 | |
info: It worked if it ends with Nodejitsu ok | |
info: Executing command deploy | |
info: Analyzing application dependencies in node server/server.js | |
warn: Local package version appears to be old | |
warn: The package.json version will be incremented automatically | |
warn: About to write /Users/morganallen/devel/NKO3/derpatron/package.json | |
warn: Using '*' as a version for dependencies may eventually cause issues | |
warn: Use specific versions for dependencies to avoid future problems |
This file contains hidden or 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
#!/usr/bin/env node | |
var udev = require("udev"); | |
var monitor = udev.monitor(); | |
monitor.on("add", function(device) { | |
// change vendor and model IDs to match your device if not Garmin Edge 305 | |
if(device.ID_VENDOR_ID === "091e" && device.ID_MODEL_ID === "0003") { | |
require("child_process").spawn("xdg-open", ["http://app.strava.com/upload/garmin_new"], { | |
env: process.env |
OlderNewer