npm set prefix ~/.node
export PATH=$HOME/.node/bin:$PATH >> ~/.profile
wget http://npmjs.org/install.sh
or simply download via your browser. This is a shell script from npmjs.org and I found to be safe to run, please ensure you're happy before executing the script.sh install.sh
(note: not sudo)
View crop.js
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
var spawn = require('child_process').spawn; | |
var Stream = require('stream'); | |
/** | |
* crops and resizes images to our desired size | |
* @param {Stream} streamIn in stream containing the raw image | |
* @return {Stream} | |
*/ | |
exports.cropImage = function(streamIn){ |
View Q_post_example.js
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
var body = JSON.stringify({ | |
token: 'foo', | |
files: files // Array of filenames | |
}); | |
var headers = { | |
'Content-Type': 'application/json', | |
'Content-Length': Buffer.byteLength(body, 'utf8') | |
}; |
View package.json
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
"scripts": { | |
"test": "grunt travis --verbose" | |
} |
View no-sudo-npm.md
View app.js
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
angular.module('app', []).config(require('./common/exceptions’)); |
View gist:eae45ff9d9aeb9788bb0
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
-*.min.js,-*.min.map,-app/_bower_components/*,-node_modules/*,-.tmp/*,-.jekyll/*,-.sass-cache/*,-dist/*,-public/*,-tmp/*,-vendor/bundle/* |
View gist:4f1fcef9da7dde4c91bf
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
osascript -e 'display notification "Reloaded browser..." with title "LiveReload"' |
View PopUpCombo.as
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
package | |
{ | |
import flash.display.DisplayObject; | |
import flash.events.KeyboardEvent; | |
import flash.events.MouseEvent; | |
import flash.geom.Point; | |
import flash.geom.Rectangle; | |
import flash.ui.Keyboard; | |
import mx.controls.PopUpButton; |
View gist:1016612
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
task :default => :list do | |
%x{touch readme.txt} | |
end | |
task :list do | |
@dump=%x{ls} | |
puts "Directory contents: #{@dump}" | |
end |
View FlexTestRunner.mxml
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
<?xml version="1.0" encoding="utf-8"?> | |
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" | |
xmlns:s="library://ns.adobe.com/flex/spark" | |
minWidth="800" | |
minHeight="600" | |
creationComplete="creationCompleteHandler(event)"> | |
<fx:Script> | |
<![CDATA[ | |
import asunit.core.TextCore; |
OlderNewer