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
" Map Leader | |
let mapleader = "," | |
imap jj <Esc> " map jj to escape | |
:map <leader>dd "_dd " Map ',dd' to delete line and put in black-hole register | |
nmap <leader>w :w!<cr> " Shortcut | |
" Fast editing of the .vimrc | |
map <leader>e :e! ~/.vimrc<cr> | |
" When vimrc is edited, reload it |
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
" Map Leader | |
let mapleader = "," | |
imap jj <Esc> " map jj to escape | |
:map <leader>dd "_dd " Map ',dd' to delete line and put in black-hole register | |
nmap <leader>w :w!<cr> " Shortcut | |
" Fast editing of the .vimrc | |
map <leader>e :e! ~/.vimrc<cr> | |
" Initiate Pathogen |
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 moment = require('moment'); | |
var request = require('request'); | |
exports.formatDate = function(format, date) { | |
}; | |
// Takes NDBC Buoy ID, and returns | |
// series of readings | |
var fetchBuoy = function(buoyId) { | |
request('http://www.ndbc.noaa.gov/data/5day2/' + buoyId + '_5day.txt', function(err, response, body){ |
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
// Takes NDBC Buoy ID, and returns | |
// series of readings | |
var fetchBuoy = function(buoyId) { | |
var path = 'http://www.ndbc.noaa.gov/data/5day2/' + buoyId + '_5day.txt'; | |
request(path, function(err, response, body) { | |
if(err) { | |
throw err; | |
} | |
return body; | |
}); |
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
for(i = 0; i < results.length; i++) { | |
var row = results[i]; | |
// construct timestamp for raw results | |
// YYYY-MM-DD H:H ZZ | |
// Sample: 2012-04-13 00:10 +0000 | |
var t =row[0] + "-" + row[1] + "-" + row[2] + ' ' + row[3] + ":" + row[4] + ' +0000' | |
// TODO | |
// format date an respect timezone |
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
// controller | |
exports.createWave = function(req, res) { | |
// buoys come in from client sorted | |
var buoys = req.body.wave.buoys; | |
// how would I add an index to them | |
// and save below? | |
var wave = new Wave({ |
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
/** | |
* Scrolling shadows by @kizmarh and @leaverou | |
* Only works in browsers supporting background-attachment: local; & CSS gradients | |
* Degrades gracefully | |
*/ | |
html { | |
background: white; | |
font: 120% sans-serif; | |
} |
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
/* | |
* Internal: Convert the request for a url into a promise | |
* | |
* url - the String to fetch | |
* | |
* Example: return request('http://www.google.com') | |
* | |
* Returns a promise | |
*/ | |
var request = function(url) { |
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
// Set up the copyright information | |
// Each image used should indicate its copyright permissions | |
var myCopyright = new GCopyrightCollection("© "); | |
myCopyright.addCopyright(new GCopyright('Demo', | |
new GLatLngBounds(new GLatLng(-90,-180), new GLatLng(90,180)), | |
0,'©2007 Google')); | |
// Create the tile layer overlay and | |
// implement the three abstract methods | |
var tilelayer = new GTileLayer(myCopyright); |
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.listLogs = function(req, res) { | |
SurfSession.find() | |
.populate('location') | |
.run(function(err, log) { | |
Wave.find(function(err, waves) { | |
var surfHeight = SurfSession.schema.path('surfHeight').enumValues; | |
var surfConditions = SurfSession.schema.path('surfConditions').enumValues; | |
var surfStoke = new SurfSession().generateStoke(); | |
var currentYear = moment().year(); | |
var surfSessionsThisYear = 0; |
OlderNewer