I used Mocha for the testing framework and Chai for the assertion library.
See http://actionherojs.com for ActionHero information.
- test
- actions
| <script type="text/javascript"> | |
| var currentPosition = 0; | |
| if (localStorage.currentPlayerPosition) { | |
| currentPosition = localStorage.currentPlayerPosition; | |
| } | |
| player.once('play', function (){ | |
| 'use strict'; | |
| if (currentPosition > 0 && Math.abs(player.getDuration() - currentPosition) > 5) { | |
| player.seek(currentPosition); | |
| } |
| var makeComputersAwesome = function(){ | |
| return buildC() | |
| .then(function(){ | |
| return P.all([ | |
| buildCPlusPlus(), | |
| buildECMALang(), | |
| buildErlang() | |
| ]) | |
| }) | |
| .then(function(){ |
| 'use strict'; | |
| var fs = require('fs') | |
| var SSH = require('ssh2') | |
| var conn = new SSH() | |
| conn.on('ready',function(){ | |
| conn.exec('cat .ssh/known_hosts',function(err,stream){ | |
| stream.setEncoding('utf-8') | |
| stream.on('readable',function(){ | |
| console.log('stream readable') |
| #!/bin/sh | |
| # Wonder Shaper | |
| # please read the README before filling out these values | |
| # | |
| # Set the following values to somewhat less than your actual download | |
| # and uplink speed. In kilobits. Also set the device that is to be shaped. | |
| # All config needs to be done in /etc/config/wshaper | |
| #. /lib/functions.sh |
| 'use strict'; | |
| var statTracker = function(interval){ | |
| if(!interval) interval = 60000 | |
| //hits (would be stored in mongo | |
| var hits = {total: 0, hour: 0, day: 0, month: 0} | |
| //last counters | |
| var last = {hour: 0, day: 0, month: 0} | |
| //previous time increments |
I used Mocha for the testing framework and Chai for the assertion library.
See http://actionherojs.com for ActionHero information.
If you are attempting the follow the NPM style coding guidelines these configurations may help you get up and running.
There are a couple standalone files
This took me several hours to figure out so I figured it was worth writing down.
Hopefully this step by step can be used to get node running locally without a lot of problems that are commonly ran into.
Update July 7th 2014 - Updated most of the versions including not pointing to the heartbleed version of OpenSSL
| #!/bin/bash | |
| pkg="$1" | |
| cd $1 | |
| #check for untracted files | |
| if [ $(git status | grep -i "Untracked files" | wc -l) -gt 0 ]; then | |
| echo "Untracked files cant push" | |
| exit |
| #!/bin/bash | |
| msg=$1 | |
| commit() { | |
| for line in $1; do | |
| echo "Committing $line" | |
| cd $line; | |
| git commit -a -m "$2" | |
| cd .. |