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
/** | |
* Override res.render to do any pre/post processing | |
*/ | |
app.use(function(req, res, next) { | |
var render = res.render; | |
res.render = function(view, options, fn) { | |
var self = this, | |
options = options || {}, | |
req = this.req, | |
app = req.app, |
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
{ | |
"name": "project", | |
"version": "0.0.0", | |
"authors": [ | |
"Eric Barnes <[email protected]>" | |
], | |
"license": "MIT", | |
"private": true, | |
"ignore": [ | |
"**/.*", |
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
#!/bin/bash | |
# Thanks to this post: | |
# http://blog.ikato.com/post/15675823000/how-to-install-consolas-font-on-mac-os-x | |
brew install cabextract | |
cd ~/Downloads | |
mkdir consolas | |
cd consolas | |
curl -O http://download.microsoft.com/download/f/5/a/f5a3df76-d856-4a61-a6bd-722f52a5be26/PowerPointViewer.exe | |
cabextract PowerPointViewer.exe |
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
FROM ubuntu:14.04 | |
MAINTAINER likang | |
#instalando python e scrapy | |
RUN apt-get update | |
RUN apt-get install -y python python-pip python-dev libxml2-dev libxslt-dev libffi-dev libssl-dev | |
RUN pip install lxml && pip install pyopenssl && pip install Scrapy && pip install service_identity | |
#instalando o git | |
RUN apt-get install -y git |
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
// ES6 for loops | |
// ============= | |
// Things in ES6 can be "iterable". Arrays are iterable by default. | |
var fruits = ['Apple', 'Banana', 'Grape']; | |
for (var fruit of fruits) | |
console.log('Fruit: ' + fruit); |
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 gulp = require('gulp'), | |
sass = require('gulp-sass'), | |
browserify = require('gulp-browserify'), | |
concat = require('gulp-concat'), | |
embedlr = require('gulp-embedlr'), | |
refresh = require('gulp-livereload'), | |
lrserver = require('tiny-lr')(), | |
express = require('express'), | |
livereload = require('connect-livereload') | |
livereloadport = 35729, |
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
#!/bin/sh | |
######################################################### | |
# usage | |
#do_mongoexport '2015-04-01' '2015-04-02' 'hoge' | |
######################################################### | |
get_millis() | |
{ | |
if [ $# != 1 ]; then |
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
#!/bin/bash | |
function usage { | |
printf "Usage:\n$0 <db_name> <collection_name> <output_csv_file>\n" | |
exit 1 | |
} | |
db_name=$1 | |
collection=$2 | |
output_file=$3 |
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
# tmux v2.0 installation steps for Ubuntu 14.04 (Trusty Tahr) | |
tmux -V | |
sudo apt-get update | |
sudo apt-get install -y python-software-properties software-properties-common | |
sudo add-apt-repository -y ppa:pi-rho/dev | |
sudo apt-get update | |
sudo apt-get install -y tmux | |
tmux -V | |
# tmux v1.9 installation steps for Ubuntu 14.04 (Trusty Tahr) |
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 -XPOST http://localhost:9200/test/articles/1 -d '{ | |
"content": "The quick brown fox" | |
}' | |
curl -XPOST http://localhost:9200/test/articles/2 -d '{ | |
"content": "What does the fox say?" | |
}' | |
curl -XPOST http://localhost:9200/test/articles/3 -d '{ | |
"content": "The quick brown fox jumped over the lazy dog" | |
}' | |
curl -XPOST http://localhost:9200/test/articles/4 -d '{ |
NewerOlder