Skip to content

Instantly share code, notes, and snippets.

0 info it worked if it ends with ok
1 verbose cli [ '/Users/me/.nvm/versions/node/v6.5.0/bin/node',
1 verbose cli '/Users/me/.nvm/versions/node/v6.5.0/bin/npm',
1 verbose cli 'dedupe' ]
2 info using npm@3.10.3
3 info using node@v6.5.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly dedupe normalizeTree
@roblg
roblg / gist:2400902
Created April 16, 2012 19:25
retrieving a basic auth-protected CSV with Google Spreadsheets and Google App Scripting
// this function assumes the CSV has no fields with commas,
// and strips out all the double quotes
function parseCsvResponse(csvString) {
var retArray = [];
var strLines = csvString.split(/\n/g);
var strLineLen = strLines.length;
for (var i = 0; i < strLineLen; i++) {
var line = strLines[i];
if (line != '') {
@roblg
roblg / .htaccess
Created August 18, 2011 06:24
.htaccess for hiding .git subdirectory
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/[.]git.*
RewriteRule ^ - [L,R=404]
@roblg
roblg / connect-to-every-dojo-event.js
Created August 13, 2011 01:06
Connect to every event on a dojo widget, and log when the event is fired.
for (var k in widget) {
// connect to functions that start with 'on'. Seems pretty close to what we want...
if (k.substring(0,2) === 'on' && typeof this.editor[k] == 'function') {
(dojo.hitch(this, function (func) {
this.connect(widget, func, function () {
console.log("editor." + func);
});
}))(k);
}
}
@roblg
roblg / kill-skype.sh
Created June 1, 2011 03:42
A script to kill skype when it gets uppity
#!/bin/sh
# kill (with extreme prejudice)
# ps -C skype,skype-wrapper -o pid= ==> displays only the PIDs of processes matching skype,skype-wrapper
# run it through sed, which removes the leading spaces, then does a multiline match, removing the newlines
kill -9 `ps -C skype,skype-wrapper -o pid= | sed -e 's/ //g' -e '/$/ { N; s/\n/ /; }'`