Setup:
$ mongo
> use pubsub
> db.createCollection('messages', { capped: true, size: 100000 })
> db.messages.insert({})
$ sudo apt-get update && sudo apt-get install -y \ | |
build-essential \ | |
git \ | |
libopenblas-dev python-dev python-pip \ | |
python-nose python-numpy python-scipy | |
# or `sudo pip install ...` | |
$ pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git |
PROJECT="your-project-name" | |
SEARCH=$1 | |
FILE=$2 | |
CLUSTER_FILTER=$3 | |
if [ -z $SEARCH ]; then | |
echo "Missing param. 1st param is the search phrase" | |
exit 1 | |
fi |
# list code lines | |
find . -type f -name "*.ts" -exec cat {} + | sort -u | |
# count them | |
find . -type f -name "*.ts" -exec cat {} + | sort -u | wc -l |
### | |
a small connect middleware proxy for cross domain ajax | |
@path first match group will be forwarded | |
@host the host you want to proxy | |
connect_server.use proxy '^(/.+)', 'api.twitter.com' | |
connect_server.use proxy '^/gh(/.+)', 'api.github.com' | |
### |
<!-- country codes (ISO 3166) and Dial codes. --> | |
<select name="countryCode" id=""> | |
<option data-countryCode="GB" value="44" Selected>UK (+44)</option> | |
<option data-countryCode="US" value="1">USA (+1)</option> | |
<optgroup label="Other countries"> | |
<option data-countryCode="DZ" value="213">Algeria (+213)</option> | |
<option data-countryCode="AD" value="376">Andorra (+376)</option> | |
<option data-countryCode="AO" value="244">Angola (+244)</option> | |
<option data-countryCode="AI" value="1264">Anguilla (+1264)</option> | |
<option data-countryCode="AG" value="1268">Antigua & Barbuda (+1268)</option> |
# This script installs Caffe and pycaffe on Ubuntu 14.04 x64 or 14.10 x64. CPU only, multi-threaded Caffe. | |
# Usage: | |
# 0. Set up here how many cores you want to use during the installation: | |
# By default Caffe will use all these cores. | |
# an alternative way: | |
# One way is to use OpenBLAS instead of the default ATLAS. To do so, | |
# sudo apt-get install -y libopenblas-dev | |
# Before compiling Caffe, edit Makefile.config, replace BLAS := atlas by BLAS := open | |
# After compiling Caffe, running export OPENBLAS_NUM_THREADS=4 will cause Caffe to use 4 cores. |