I hereby claim:
- I am ishestak on github.
- I am irina (https://keybase.io/irina) on keybase.
- I have a public key whose fingerprint is 5EBC 83B1 F568 57CF 0869 646C CBE8 5651 05E0 BEDE
To claim this, I am signing this object:
# Sample implementation of quicksort and mergesort in ruby | |
# Both algorithm sort in O(n * lg(n)) time | |
# Quicksort works inplace, where mergesort works in a new array | |
def quicksort(array, from=0, to=nil) | |
if to == nil | |
# Sort the whole array, by default | |
to = array.count - 1 | |
end |
I hereby claim:
To claim this, I am signing this object:
airpair ;
# define a construct
data Maybe a = Just a | Nothing
#define martist
martist :: Maybe String
martist = Just "Varen"
#define mtrack
mtrack :: Maybe String
###Building Interactive npm Command Line Modules -- all the things.
Here you are coding away, when you realize you're in desperate need of a quick shell script to get your project cleaned up. You're standing at a fork in the road: Bash or Node? You choose the road less travelled by (for some reason) -- Node. I congratulate you on this decision. You've written it, you may have published it, and it certainly works. But what now? Is this all a command line module Node is good for: a project clean up and some data manipulation?
Let's take it a step further. Let's make a command line module that's more than just your compiling script. I am, of course, talking about making it more interactive.
In this talk I want to take you on an adventure that will require cunning, bravery, and maybe some magic. We will walk through obtaining and parsing data, using Node's process functions, and finally improving your module's user experience.
Alright, that's a mouthful. Let's break it down. | |
1. We will be looking at cellular automata. A cellular automata is a set of units governed with very simple rules. These units make up a complex system, or model. | |
2. We can train cellular automata to genetically evolve, making themselves better overtime. We can make them adhere to a set of rules that would make the system reach a certain outcome at the end of N generations. We can even use these concepts in the wild. | |
3. We will be doing it all with JavaScript. | |
it('fails with invalid command', function (done) { | |
yargs('marsupial -w 10') | |
.command('marsupial', 'wombat burrows', function (yargs, argv) { | |
console.log(argv) | |
return argv | |
}) | |
.demand(1, ['w', 'b']) | |
.strict() | |
.fail(function (msg) { | |
msg.should.equal('Missing required argument: b') |
irina@aniri-Satellite-L350 ~/developer/yargs $ npm test
> [email protected] pretest /home/irina/developer/yargs
> standard
> [email protected] test /home/irina/developer/yargs
> nyc --cache mocha --require ./test/before.js --timeout=4000 --check-leaks