View airportQueries.js
var chinaAirports = db.airports.find({countryName:"China"}).map(x=>x._id)
var USAirports = db.airports.find({countryName:"United States"}).map(x=>x._id)
var mapFunction = function() {
var monthPtr = new Date(this.effectiveDate);
monthPtr.setDate(1);
while(monthPtr <= this.discontinuedDate) {
var dayPtr = new Date(monthPtr);
var nextMontStart = new Date(monthPtr);
nextMontStart.setMonth(monthPtr.getMonth() + 1);
View leafletSnippet.js
// This covers the full web-mercator range
imageBounds = [[-85.051129, -180], [85.051129, 180]]
L.imageOverlay('/test.png', imageBounds).addTo(map)
View setup-development-env.sh
# I like to set up a c9.io ssh workspace for terminal access and editing files.
# In order to do that it's necessairy to install a recent version of node.js
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install -y gcc g++ make nodejs git
# This is the c9 set-up script. I'm not positive it will remain valid forever.
curl https://raw.github.com/c9/install/master/install.sh | bash
# You will also need to add your c9 key to .ssh/authorized_keys
# Python setup
View FavoritePodcasts.md

FLOSS Weekly

A talk show about open source software. Every week a different open source project is featured along with a guest who is somehow involved in it.

Clarksworld Magazine

SciFi short stories. These are some of my favorites:

View findText.js
walk = document.createTreeWalker(document, NodeFilter.SHOW_TEXT, null, false);
prevSentence = "";
sentences = [''];
while(n=walk.nextNode()) {
nextSentences = n.nodeValue.split('.');
sentences[sentences.length - 1] += nextSentences.pop();
sentences = sentences.concat(nextSentences);
}
sentences.forEach(function(sentence){
if(/test/gi.test(sentence)) console.log(sentence);
View filter.js
//Implementation of Fastie's macro for identifying emission or absorption lines
//see: https://github.com/jywarren/spectral-workbench/issues/184
/*
Description:
To objectively determine the wavelengths of emission or absorption lines,
you have to separate signal from noise in a graph of wavelength intensities.
Especially when looking for peaks or valleys that disrupt a continuous (black body radiation) spectrum,
the low frequency (maybe > 20 nm) information becomes noise.
To eliminate it, fit a cubic spline or other easily adjustable curve to each color channel separately.
Compute the deviations of each channel from its curve and average the three new curves into a single curve,
View download.js
setup: function() {
$('#myModal').remove();
$('body').append('<div class="modal fade" id="myModal" role="dialog"><div class="modal-content dl-btns"></div></div>');
$.each($W.data, function(idx, data){
var $dlBtn = $('<a class="btn btn-success dl-btn">Download ' + (data.label || "") + ' csv<a>');
$dlBtn.css('margin', 5);
$('.dl-btns').append($dlBtn);
var csv = $.map(data.data, function(row, idx){
return row.join(',');
}).join('\n');
View FastieEmissionAbsorbtion.js
//Implementation of Fastie's macro for identifying emission or absorption lines
//see: https://github.com/jywarren/spectral-workbench/issues/184
/*
Description:
To objectively determine the wavelengths of emission or absorption lines,
you have to separate signal from noise in a graph of wavelength intensities.
Especially when looking for peaks or valleys that disrupt a continuous (black body radiation) spectrum,
the low frequency (maybe > 20 nm) information becomes noise.
To eliminate it, fit a cubic spline or other easily adjustable curve to each color channel separately.
Compute the deviations of each channel from its curve and average the three new curves into a single curve,
View occasionallyUsefulWebsites.md

zoho mail Webmail provider that supports custom domains (see also: mail.live.com)

mx domain lookup Used it to debug issues when setting up custom email domains.

image proxy Caches and resizes images for websites

picozu web image editor I like this one because there is no sign-up and you can drag and drop onto it.