Skip to content

Instantly share code, notes, and snippets.

@qcom
qcom / npm-debug.log
Created January 15, 2012 06:10
npm debug log file
info it worked if it ends with ok
verbose cli [ 'node', '/usr/local/bin/npm', '-g', 'install', 'express' ]
info using npm@1.1.0-beta-10
info using node@v0.6.7
verbose config file /Users/zach/.npmrc
verbose config file /usr/local/etc/npmrc
verbose config file /usr/local/lib/node_modules/npm/npmrc
verbose into /usr/local/lib [ 'express' ]
verbose cache add express
verbose cache add [ 'express', null ]
@qcom
qcom / app.js
Created June 29, 2012 18:09
casperjs scraper
var skus = [113247,113248,113249];
var sku = [113247];
function Product(catalogNumber, obsolete, replacement, overview, features, specs, productNumber) {
this.catalogNumber = catalogNumber;
this.obsolete = obsolete;
this. replacement = replacement;
this.overview = overview;
this.features = features;
this.specs = specs;
@qcom
qcom / app.js
Created June 29, 2012 18:45
functioning casperjs scraper
var skus = [113247,113248,113249];
var sku = [113247];
var casper = require('casper').create({
clientScripts: ['jQuery.js']
});
casper.start('http://bradyid.com', function() {
this.fill('form[action="/bradyid/catalog/siteSearchResultsView.do"]', { 'searchTerms': sku}, true);
});
@qcom
qcom / index.html
Created June 29, 2012 22:20
html for jQuery selector
<div class="tabContHolder">
<h3>
<span class="cmsblue">Description for Floor Marking Tape - 2" Black and Yellow Toughstripe Polyester</span>
</h3>
<p>Made with the most durable floor marking tape, ToughStripe™ Floor Marking
Tape is a long-lasting, heavy-duty solution for marking floors, aisles,
work cells and other designated areas throughout your facility.</p>
<p>
<br>
<b>Superior Durability:</b>
@qcom
qcom / app.js
Created July 2, 2012 21:04
A tiny web scraper written with casperjs
var casper = require('casper').create({
clientScripts: ['libs/jQuery.js', 'libs/underscore.js']
});
var fs = require('fs');
// this is obnoxious
var skus = [113247, 113248, 113249, 113250, 113245, 113246, 113251, 113252, 113265, 113266, 113267, 113268, 113269, 113264, 113263, 113256, 113257, 113254, 113255, 113260, 113261, 113258, 113259, 113262, 113253, 114888, 114889, 114890, 114891, 114892, 114893, 114894, 114895, 114896, 114897, 142109, 142110, 142111, 55349, 55331, 55350, 56912, 55332, 58200, 58201, 58202, 58203, 58220, 58222, 58250, 58251, 58252, 58253, 58221, 58223, 102838, 102836, 102834, 102837, 102833, 102839, 102825, 102829, 102835, 102828, 102832, 102840, 102826, 102830, 102827, 102831, 104310, 104311, 104312, 104313, 104314, 104315, 104316, 104317, 104318, 104319, 104340, 104341, 104342, 104343, 104344, 104345, 104346, 104347, 104348, 104349, 104370, 104371, 104372, 104373, 104374, 104375, 104376, 104377, 104378, 104379, 104400, 104401, 104402, 104403, 104404, 104405, 104406, 104407, 104408
@qcom
qcom / output
Created August 9, 2012 19:35
brew update --verbose
xcrun: Error: failed to exec real xcrun. (No such file or directory)
git checkout -q master
==> git rev-parse -q --verify HEAD
f02d5c45d256d0b44b762b05250cb27e49c907d4
git config core.autocrlf false
git pull origin refs/heads/master:refs/remotes/origin/master
error: RPC failed; result=22, HTTP code = 405
fatal: The remote end hung up unexpectedly
Error: Failure while executing: git pull origin refs/heads/master:refs/remotes/origin/master
@qcom
qcom / output
Created August 9, 2012 21:25
brew update
error: The following untracked working tree files would be overwritten by merge:
Library/Formula/ninja.rb
Please move or remove them before you can merge.
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
@qcom
qcom / test.js
Created August 15, 2012 19:36
jade locals fail
// y u no work
var jade = require('jade');
var fn = jade.compile("h1 #{myTitle}", {
locals: {
myTitle: 'kittens'
}
});
@qcom
qcom / products.js
Created August 17, 2012 16:20
SyntaxError: Unexpected token
// For some reason this code yields the following error upon execution:
// undefined: 1
//
// ^
// SyntaxError: Unexpected token
// Commenting out the JSON.parse() solves the error, but I don't understand what's wrong with the line
var fs = require('fs');
@qcom
qcom / skus.txt
Created October 17, 2012 23:12
SKUs
5400D
7122D
7122D
5401D
7123D
7123D
7123D
7124D
7124D
5408D