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:b409b5bb6aaa0dad71c2
Created August 3, 2014 07:22
ionic cordova datepicker
$scope.showDate = function() {
event.stopPropagation();
if (window.plugins && window.plugins.datePicker) {
window.plugins.datePicker.show({
date : $scope.date,
mode : 'time'
}, function(date) {
$scope.$apply(function() {
// Store date
@ojacquemart
ojacquemart / gist:9280350
Created February 28, 2014 21:31
BodyBindKeydown
.directive('bindKeydown', function () {
return {
restrict: 'A',
link: function (scope, element) {
element.bind('keydown', function (e) {
if (e.target === element[0]) {
scope.$broadcast('body:keydown', e.keyCode);
}
});
}
@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