Clone and build Node for analysis:
$ git clone https://github.com/joyent/node.git
$ cd node
$ export GYP_DEFINES="v8_enable_disassembler=1 v8_object_print=1"
$ ./configure
$ make -j4
| # 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' |
| #!/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: |
| // 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() { |
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.
Yet another framework syndrome
| Name | Date | URL | Stars |
|---|---|---|---|
| Jake | April 2010 | https://github.com/mde/jake | 866 |
| Brunch | January 2011 | http://brunch.io/ | 3359 |
| 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){ |
| 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); |