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
MAVEN_HOME=/usr/share/java/apache-maven-3.0.5 | |
JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home | |
PATH=$MAVEN_HOME/bin:$PATH | |
PATH=$JAVA_HOME/bin:$PATH | |
PATH=/System/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH | |
PATH=/usr/local/mongodb/bin:$PATH | |
PYTHONPATH=/System/Library/Frameworks/Python.framework/Versions/2.7/bin | |
PYTHON=$PYTHONPATH/python |
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
require('dotq'); | |
function demoCallback(cb){ | |
setImmediate(cb('test')); | |
} | |
var test = demoCallback.promise().then(function(str){ | |
return str; | |
}); |
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
// 如下,想限制匹配长度等于24的字符串,因为ID是mongodb的id | |
// Sample in Expressjs.com | |
router.param(function(name, fn){ | |
if (fn instanceof RegExp) { | |
return function(req, res, next, val){ | |
var captures; | |
if (captures = fn.exec(String(val))) { | |
req.params[name] = captures; | |
next(); |
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" ?> | |
<resources> | |
<style name="KitKatTheme" parent="android:Theme.Holo.Light"> | |
<item name="android:windowBackground">@color/green</item> <!--This works as background color on Android--> | |
<item name="android:actionBarStyle">@style/ActionBar.Solid.KitKat</item> | |
</style> | |
<!--<style name="ActionBar.Solid.KitKat" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">--> | |
<!-- <item name="android:background">@color/xamarinblue</item>--> | |
<!--</style>--> |
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 mongoose = require('mongoose'); | |
var config = require('../config'); | |
var db = mongoose.createConnection(); | |
var options = { | |
db: { native_parser: true }, | |
server: { | |
poolSize: 5, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
vImageBoxConvolve_ARGB8888(&effectInBuffer, &effectOutBuffer, NULL, 0, 0, (uint32_t)radius, (uint32_t)radius, 0, kvImageEdgeExtend); | |
vImageBoxConvolve_ARGB8888(&effectOutBuffer, &effectInBuffer, NULL, 0, 0, (uint32_t)radius, (uint32_t)radius, 0, kvImageEdgeExtend); | |
vImageBoxConvolve_ARGB8888(&effectInBuffer, &effectOutBuffer, NULL, 0, 0, (uint32_t)radius, (uint32_t)radius, 0, kvImageEdgeExtend); |
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
source 'https://rubygems.org' | |
gem 'rails', '4.2.0.beta2' | |
gem 'rails-api' | |
gem 'spring', :group => :development | |
gem 'pg' |
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
# React Native: Parsing/Crawling HTML | |
## Ugly Way | |
[xmldom](https://www.npmjs.com/package/xmldom) + [xpath](https://www.npmjs.com/package/xpath) | |
## Much Better Way | |
[cheerio][https://www.npmjs.com/package/cheerio]. | |
Note: You MUST also install `buffer`, `events` and `stream` to avoid dependency errors. | |
In the past, cheerio uses `fs` so that it is not possible to use it in the environment of react native. But now it works fine. |
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
curl -sSL https://get.docker.com/ | sh | |
curl -L "https://github.com/docker/compose/releases/download/1.8.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
chmod +x /usr/local/bin/docker-compose | |
echo 'docker installed, cheers!' | |
# apt-get install -y zsh | |
# zsh | |
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" |
OlderNewer