using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies
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
# Enable Zsh options for history | |
setopt EXTENDED_HISTORY | |
setopt INC_APPEND_HISTORY | |
setopt SHARE_HISTORY | |
setopt HIST_FIND_NO_DUPS | |
# Clear local history and load a fresh session for the current directory | |
function load_local_history() { | |
if [[ -f .zsh_cmd_history ]]; then | |
# Clear in-memory history and reload only local history |
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
#!/usr/bin/env node | |
require(__dirname+"/processor-usage.js").startWatching(); | |
var shouldRun = true; | |
var desiredLoadFactor = .5; | |
function blockCpuFor(ms) { | |
var now = new Date().getTime(); | |
var result = 0 |