Skip to content

Instantly share code, notes, and snippets.

View ojacquemart's full-sized avatar

Olivier Jacquemart ojacquemart

View GitHub Profile
@ojacquemart
ojacquemart / RxFirebase.java
Created May 30, 2016 22:48 — forked from gsoltis/RxFirebase.java
RxJava Bindings for Firebase
package com.firebase.client;
import com.firebase.client.core.Constants;
import rx.Observable;
import rx.Subscriber;
import rx.functions.Action0;
import rx.functions.Func1;
import rx.subscriptions.Subscriptions;
public class RxFirebase {
@ojacquemart
ojacquemart / gist:7126635
Created October 23, 2013 20:57
curl basic auth
curl -i -H "Authorization: base64token" http://localhost:9000/api/foo
'use strict';
describe('Directive: afterDate', function () {
beforeEach(module('yoApp'));
var scope,
compile,
element
;
@ojacquemart
ojacquemart / gist:6982968
Created October 14, 2013 22:02
mongoexport
mongoexport --host HOST -u USER -p PASSWORD --db DB --collection COLL --out FILE.json
@ojacquemart
ojacquemart / gist:6473650
Created September 7, 2013 07:42
Heroku buildpack-scala#cleancache
heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-scala.git#cleancache --app myapp
git push heroku master
heroku config:remove BUILDPACK_URL --app myapp
@ojacquemart
ojacquemart / gist:5658745
Last active December 17, 2015 19:09
Mongorestore
mongorestore --db dbname path
To delete existing database:
use dbname
db.dropDatabase()
mongodump --host host --db db --port 10027 --username username --password pwd --out path
@ojacquemart
ojacquemart / mongom101j-week3-exercise1.scala
Last active December 15, 2015 01:58
Mongo M101J: Week3#Exercise1
package tengen
import play.api._
import play.api.libs.json._
import play.api.mvc._
import play.api.Logger
import play.api.Play.current
import play.modules.reactivemongo._
import play.modules.reactivemongo.ReactiveMongoPlugin
@ojacquemart
ojacquemart / mongom101j-week2-exercise2.scala
Last active December 14, 2015 17:59
Mongo M101J : Week2#Exercise2
import play.api._
import play.api.libs.json._
import play.api.mvc._
import play.api.Logger
import play.api.Play.current
import play.modules.reactivemongo._
import play.modules.reactivemongo.ReactiveMongoPlugin
import org.joda.time.DateTime
@ojacquemart
ojacquemart / gist:5060041
Created February 28, 2013 20:54
Get webpage content in python.
import urllib2
response = urllib2.urlopen('http://github.com')
html = response.read()
print html