sudo apt-get install libxml2-dev libxslt1-dev
sudo apt-get install libffi-dev libssl-dev
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
domain = "example.com" | |
settings = { | |
:hostname => "adam", | |
:box => "ubuntu/trusty64", |
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
http://graphics.stanford.edu/~seander/bithacks.html | |
http://literallycanvas.com/ | |
http://ufldl.stanford.edu/tutorial/ | |
http://www.iro.umontreal.ca/~pift6266/H10/notes/deepintro.html |
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 FilteredList = React.createClass({ | |
filterList: function(event){ | |
var updatedList = this.state.initialItems; | |
updatedList = updatedList.filter(function(item){ | |
return item.toLowerCase().search( | |
event.target.value.toLowerCase()) !== -1; | |
}); | |
this.setState({items: updatedList}); | |
}, | |
getInitialState: function(){ |
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
/** @jsx React.DOM */ | |
var SVGComponent = React.createClass({ | |
render: function() { | |
return this.transferPropsTo( | |
<svg>{this.props.children}</svg> | |
); | |
} | |
}); | |
Starts with: abc Ends with: xyz Contains: 123 Doesn't contain: 456
-
OR
/^abc|xyz$|123|^(?:(?!456).)*$/
-
AND
/^(?=^abc)(?=.*xyz$)(?=.*123)(?=^(?:(?!456).)*$).*$/
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
## set local/fastest mirror and local timezone | |
mv /etc/apt/sources.list /etc/apt/sources.list.orig | |
cat > /etc/apt/sources.list <<EOF | |
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty main restricted universe multiverse | |
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-updates main restricted universe multiverse | |
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-backports main restricted universe multiverse | |
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-security main restricted universe multiverse |
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
// Restify Server CheatSheet. | |
// More about the API: http://mcavage.me/node-restify/#server-api | |
// Install restify with npm install restify | |
// 1.1. Creating a Server. | |
// http://mcavage.me/node-restify/#Creating-a-Server | |
var restify = require('restify'); |
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
CategorySchema.statics.getLineage = function (categoryId, flag, done) { | |
var self = this; | |
var count1 = 0; | |
var count2 = 0; | |
var recurse = function (id, results) { | |
var deferred = Promise.defer(); | |
self.findById(id, function(error, category) { | |
if (error) { |
OlderNewer