I am probably never going to get to this so I am documenting my thoughts publicly.
- Stack parse
- Consult the stack methodology that json2.js uses (should be on Google Code)
- Resig (HTML2XML) + jQuery (XMLInterpretter)
// Health page (attribution to dshaw) | |
var pkg = require('./package.json'); | |
version = pkg.version; | |
app.get('/health', function (req, res) { | |
var health = { | |
'version': pkg.version, | |
'pid': process.pid, | |
'memory': process.memoryUsage(), | |
'uptime': process.uptime() | |
}; |
## THIS READS AS user at device in pwd on git_branch | |
# Sexy Bash Prompt, inspired by "Extravagant Zsh Prompt" | |
# Screenshot: http://img.gf3.ca/d54942f474256ec26a49893681c49b5a.png | |
# A big thanks to \amethyst on Freenode | |
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color | |
elif [[ $TERM != dumb ]] && infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color | |
fi |
" 11 11 ", | |
"1 11 1", | |
"1 1", | |
"1 1", | |
" 1 1 ", | |
" 1 1 ", | |
" 11 ", | |
" " | |
vs |
/node_modules |
// Grab the current pid | |
$.get('/health', function (health) { | |
var pid = health.pid; | |
// Watch the health to see if it changes | |
setInterval(function () { | |
// If it does, refresh the page | |
$.get('/health', function (health) { | |
if (health.pid !== pid) { | |
location.reload(); |
// Asynchronous retrieval of coordinates | |
function getCoordinates(cb) { | |
// Grab geolocation from the navigator | |
var geolocation = window.navigator.geolocation; | |
// If geolocation exists, start fetching location | |
if (geolocation) { | |
geolocation.getCurrentPosition(function (position) { | |
cb(null, position.coords); | |
}, cb); |
// ASIDE: This was built during NodeKO 2012 -- hence the window.'s lying around | |
// Define latLngPadder | |
function normalizeLat(lat) { | |
var latStr = lat + ''; | |
// Guarantee a decimal place in the number | |
if (latStr.indexOf('.') === -1) { | |
latStr = latStr + '.'; | |
} |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE http://twolfson.com/ | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
$.get('{{XML_LOCATION}}', function (data, status) { | |
if (status === 'success') { | |
var $data = $(data), | |
$itemArr = $data.find('item'), | |
points = $itemArr.map(function () { | |
var $item = $(this), | |
$customFields = $item.find('customfield'), | |
$storyPointsField = $customFields.filter('{{STORY_POINT_FILTER'), | |
// $storyPointsField = $customFields.filter('[id="customfield_10004"]'), | |
storyPoints = +($storyPointsField.find('customfieldvalue').text() || 0); |