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
<br> | |
<div class="container"> | |
<div class="row"> | |
<div class="six columns"> | |
<h2>Date Range Form</h2> | |
<h5 class="small">By <a href="https://gist.github.com/cbumgard/4742703" target="_blank">Chris Bumgardner</a></h5> | |
<h3 class="subheader">Built with <a href="http://jquery.com/" target="_blank">jQuery</a>, <a href="http://api.jqueryui.com/datepicker/" target="_blank">jQuery UI DatePicker</a>, <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" target="_blank">jQuery Validation</a>, and <a href="http://foundation.zurb.com/" target="_blank">Zurb Foundation</a></h3> | |
<h5><a href="http://jsfiddle.net/chrisbumgardner/VzYQn/" target="_blank">See the jsFiddle</a></h5> |
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 fun = require('funcy') | |
, _ = fun.wildcard | |
, n; | |
for (n = 1; n <= 100; n++) { | |
console.log( | |
fun( | |
[[0, 0], function() { return 'FizzBuzz'; }], | |
[[0, _], function() { return 'Fizz'; }], | |
[[_, 0], function() { return 'Buzz'; }], | |
[_, function() { return n; }] |
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 fizz, buzz, fizzbuzz, n; | |
for (n = 1; n <= 100; n++) { | |
fizz = !(n % 3); | |
buzz = !(n % 5); | |
fizzbuzz = fizz && buzz; | |
console.log( | |
fizzbuzz ? 'FizzBuzz' : | |
(fizz ? 'Fizz' : | |
(buzz ? 'Buzz' : n))); | |
} |
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 tz = require('timezone/loaded'); | |
var time = require('time'); | |
module.exports = function() { | |
var strftime_format = '%F %T %z'; // used to convert a date into a normalized strftime format with timezone | |
var moment_format = 'YYYY-MM-DD HH:mm:ss zz'; // moment.js LDML format for parsing date strings | |
/** | |
* Convert a Javascript Date into node-time wrapper with the appropriate 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
var output, i; | |
for (i = 1; i <= 100; i++) { | |
output = ''; | |
i % 3 === 0 ? output += 'Fizz' : output; | |
i % 5 === 0 ? output += 'Buzz' : output; | |
output === '' ? output = i : output; | |
console.log(output); | |
} |
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
<!-- Put a text input to be validated into a form. Make sure it has the class "gist" for the validator. --> | |
<input id="inputGistUrl" type="text" name="gist_url" placeholder="https://gist.github.com/1234567" class="required gist"> |
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
.container | |
.featurette | |
h2.featurette-heading Welcome to #{title} | |
p.lead Everything appears to be running correctly. Here's something for your entertainment. | |
a(href='http://xkcd.com/163/') | |
img(src='http://imgs.xkcd.com/comics/donald_knuth.png') | |
hr.featurette-divider |
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
git clone https://github.com/cbumgard/node-boot | |
cd node-boot/ | |
npm install | |
grunt dev | |
node app.js |
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
// This module loads a config file in the current working directory matching the NODE_ENV variable. | |
// I.e. either './development.js' or './production.js' based on the process.env.NODE_ENV variable. | |
// If not set, it defaults to './development.js'. | |
// Can load custom environment files as well, as long as the NODE_ENV variable matches | |
// a file in the current directory. E.g. './staging.js' | |
// Usage: calling code can just require this module, e.g. "var config = require('./config')" | |
// assuming this file is named "index.js" and lives in a subdirectory named "config" of the app root. | |
var config | |
, config_file = './' + (process.env.NODE_ENV ? process.env.NODE_ENV : 'development') + '.js'; |