Yet another framework syndrome
Name | Date | URL | Stars |
---|---|---|---|
Jake | April 2010 | https://github.com/mde/jake | 866 |
Brunch | January 2011 | http://brunch.io/ | 3359 |
for (var i=1; i <= 20; i++) | |
{ | |
if (i % 15 == 0) | |
console.log("FizzBuzz"); | |
else if (i % 3 == 0) | |
console.log("Fizz"); | |
else if (i % 5 == 0) | |
console.log("Buzz"); | |
else | |
console.log(i); |
var arr = [0,1,2,3,4,5,6,7,8,9]; | |
/** | |
* Returns a circular range of an Array | |
* @param index {Number} starting position | |
* @param size {Number} size of the range | |
* @param [position] {Number} position of the range, negative values will return a range before the index | |
* @return {Array} | |
**/ | |
Array.prototype.range = function(index, size, position){ |
Yet another framework syndrome
Name | Date | URL | Stars |
---|---|---|---|
Jake | April 2010 | https://github.com/mde/jake | 866 |
Brunch | January 2011 | http://brunch.io/ | 3359 |
May 28, 2014
This code is a companion to the APIcon presentation Real-World Functional Programming by @jearldouglas and @kelleyrobinson. The slides are available here.
In this code, we compare imperative and functional implementations of a withdraw
function that might be used in a banking ATM.
// It is important to declare your variables. | |
(function() { | |
var foo = 'Hello, world!'; | |
print(foo); //=> Hello, world! | |
})(); | |
// Because if you don't, the become global variables. | |
(function() { |
#!/bin/bash | |
# Note: this is ONLY a fix for https://github.com/npm/npm/issues/4719 | |
# If you are having some OTHER issue, then DO NOT USE THIS SCRIPT. | |
# It won't help, and might cause other problems. | |
# You have been warned. | |
# Just to prove that you're not blindly copying and pasting, please | |
# remove these two lines before running: |
# Example JRuby program to display the JVM's available locales | |
# and their number, currency, and date formats. | |
# | |
# Keith R. Bennett, @keithrbennett | |
require 'java' | |
java_import 'java.util.Locale' | |
java_import 'java.text.DateFormat' | |
java_import 'java.text.NumberFormat' |