TODO: Write a project description
TODO: Describe the installation process
>> coll.insert({:date => Date.today}) | |
BSON::InvalidDocument: Date is not currently supported; use a UTC Time instance instead. | |
>> coll.insert({:date => DateTime.now}) | |
BSON::InvalidDocument: DateTime is not currently supported; use a UTC Time instance instead. | |
>> coll.insert({:date => Time.now}) #=> BSON::ObjectId('4dd39768b98f703261000003') |
#!/bin/bash | |
function jsonval { | |
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop` | |
echo ${temp##*|} | |
} | |
json=`curl -s -X GET http://twitter.com/users/show/$1.json` | |
prop='profile_image_url' | |
picurl=`jsonval` |
source :rubygems | |
gem 'sinatra' | |
gem 'json' | |
gem 'omniauth' | |
gem 'omniauth-oauth2' | |
gem 'omniauth-github' | |
gem 'omniauth-facebook' | |
gem 'omniauth-twitter' | |
# gem 'omniauth-att', :path => File.expand_path("./../../omniauth-att", __FILE__) |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import org.vertx.java.core.Handler; | |
import org.vertx.java.core.http.HttpServer; | |
import org.vertx.java.core.http.HttpServerRequest; | |
import org.vertx.java.core.http.RouteMatcher; | |
import org.vertx.java.deploy.Verticle; | |
public class HttpRestVerticle1 extends Verticle { |
language: php | |
php: | |
- 5.3 | |
mysql: | |
database: drupal | |
username: root | |
encoding: utf8 | |
#!/bin/bash | |
for LINE in `cat "$1"`; do | |
echo 'start cloning repo:' : $LINE; | |
git clone $LINE | |
done |
// # Mocha Guide to Testing | |
// Objective is to explain describe(), it(), and before()/etc hooks | |
// 1. `describe()` is merely for grouping, which you can nest as deep | |
// 2. `it()` is a test case | |
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run | |
// before/after first/each it() or describe(). | |
// | |
// Which means, `before()` is run before first it()/describe() |
// Style 1 | |
// Export all manually | |
// Good: Calling functions inside the module is convenient | |
// Bad: module.exports becomes verbose and it's tedious to add new functions | |
function a() { | |
b() | |
} |