Note:
- that there are nine lines, not eight.
"8"
is the expected value
What am I missing?
h2.Code
var fs = require('fs');
Note:
"8"
is the expected valueWhat am I missing?
h2.Code
var fs = require('fs');
h2.Code | |
```javascript | |
var fs = require('fs'); | |
var filename = process.argv[2]; | |
var fileBuffer = fs.readFileSync(filename); | |
//get # of lines in `contents` Buffer | |
var lines = fileBuffer.toString().split("\n"); | |
lines.forEach(function(line,index){//remove \r's | |
lines[index] = line.replace(/\r/,''); |
[523]$ mongo asdf | |
MongoDB shell version: 2.0.4 | |
connecting to: asdf | |
> db.a.insert({a:1}); | |
> | |
bye | |
17:42:36-diamonds:wk2 | |
[524]$ sudo du -sh /var/lib/mongodb/asdf. | |
asdf.0 asdf.1 asdf.ns | |
17:42:36-diamonds:wk2 |
/**********************************************/ | |
/* | |
/* IR_Black Skin by Ben Truyman - 2011 | |
/* | |
/* Based on Todd Werth's IR_Black: | |
/* http://blog.toddwerth.com/entries/2 | |
/* | |
/* Inspired by Darcy Clarke's blog post: | |
/* http://darcyclarke.me/design/skin-your-chrome-inspector/ | |
/* |
// ==UserScript== | |
// @name Keep the page open | |
// @namespace http://use.i.E.your.homepage/ | |
// @version 0.1 | |
// @description enter something useful | |
// @match https://ssp.ptc.com/jira/* | |
// @copyright 2012+, You | |
// ==/UserScript== | |
setInterval(function(){ |
//you must be viewing from the overlay view (the inline-page view changes page on next-click) | |
// 1. run in console | |
// 2. copy links from console when it's done | |
// 3. paste into imgur.com or whatevs | |
var imagesArray = []; | |
var repeatClickLog; | |
var logAndClick = function(){ | |
if(document.querySelector('.videoStage').childNodes.length){ |
var Afonigizer = require('../afonigizer.js').Afonigizer; | |
var _ = require('../node_modules/underscore/underscore.js'); | |
describe("The Afonigizer", function(){ | |
'use strict'; | |
var afonigizer, i; | |
beforeEach(function(){ | |
afonigizer = new Afonigizer(Math); |
function jpgto(){ | |
local jptkeyword=$1; | |
local jptpath=$2; | |
curl -silent -F keyword=$jptkeyword -F file="@$jptpath" jpg.to/finish.php >> /dev/null; | |
echo "http://jpg.to/$jptkeyword"; | |
} | |
[you@home]$ jpgto delicious /path/to/cake.jpg |
<?php | |
//explain usage | |
if( !isset( $argv[1] ) ){ | |
echo "Usage: php " . basename(__FILE__) . " [url]"; | |
die("\n"); | |
} | |
$languages = array( 'python'=>0, 'php'=>0, 'node'=>0, 'ruby'=>0, 'java'=>0, 'javascript'=>0 ); | |
$length = count( $languages ); | |
$url = $argv[1]; |
<?php | |
//I'd add a shebang line but my php is /usr/local/zend/... and yours probably isn't | |
//if you want to run it that way, make sure to offset the argv keys by -1 | |
//explain usage | |
if( !isset( $argv[1] ) ){ | |
echo "Describes all tables in the nice mysql c client way\n"; | |
echo "Usage: php " . basename(__FILE__) . " [username] [password] [database]"; | |
die("\n"); | |
} |