Skip to content

Instantly share code, notes, and snippets.

@julienroubieu
julienroubieu / npm-install-all.sh
Created November 1, 2017 16:32
Run npm install in all subdirectories
find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && npm install" \;
@julienroubieu
julienroubieu / VehicleStartEndLocationsBug.java
Created March 9, 2017 18:55
or-tools - Illustrates incorrect use of `vehicleStarts` and `vehicleEnds` by RoutingModel
//
// Copyright 2012 Google
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software

Keybase proof

I hereby claim:

  • I am julienroubieu on github.
  • I am julienroubieu (https://keybase.io/julienroubieu) on keybase.
  • I have a public key ASA49g6oVDZnieWYIqAZyNvmzr2p_IaIKhd824_ZxTdNHQo

To claim this, I am signing this object:

@julienroubieu
julienroubieu / scrollDelegate.coffee
Last active March 2, 2016 20:52
Fix for $ionicScrollDelegate not working in modals
#
# The original Ionic $ionicScrollDelegate does not work for views in modals.
# This decorator fixes the issue by getting the handle globally instead of from the active scope.
# https://github.com/driftyco/ionic/issues/2754
#
$ionicScrollDelegateDecorator = ($provide) ->
decorateService = ($delegate) ->
$delegate.$getByHandle = (name) ->
@julienroubieu
julienroubieu / listDelegate.coffee
Last active March 2, 2016 20:53
Fix for $ionicListDelegate not working in modals
#
# The original Ionic $ionicListDelegate does not work for views in modals.
# This decorator fixes the issue by getting the handle globally instead of from the active scope.
# https://github.com/driftyco/ionic/issues/2754
#
$ionicListDelegateDecorator = ($provide) ->
decorateService = ($delegate) ->
$delegate.$getByHandle = (name) ->
@julienroubieu
julienroubieu / ion-google-place.js
Last active November 12, 2015 18:14
Updated ion-google-place.js which only calls google map API when search is performed. Master at https://github.com/israelidanny/ion-google-place/blob/master/ion-google-place.js
angular.module('ion-google-place', [])
.directive('ionGooglePlace', [
'$ionicTemplateLoader',
'$ionicBackdrop',
'$q',
'$timeout',
'$rootScope',
'$document',
'$window',
function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $document, $window) {
@julienroubieu
julienroubieu / JavaOptionals.scala
Last active November 14, 2019 20:46
Implicit conversions between Scala Option and Java 8 Optional
import java.util.Optional
/**
* Conversions between Scala Option and Java 8 Optional.
*/
object JavaOptionals {
implicit def toRichOption[T](opt: Option[T]): RichOption[T] = new RichOption[T](opt)
implicit def toRichOptional[T](optional: Optional[T]): RichOptional[T] = new RichOptional[T](optional)
}
@julienroubieu
julienroubieu / template.scala.html
Last active August 29, 2015 14:19
Print an option value in a Play scala template
// Surrounding div is only printed when optional.isDefined()
@for(someValue <- optional) { <div class='value'>@someValue</div> }
@julienroubieu
julienroubieu / getdate.sh
Last active December 21, 2015 19:20
Automator shell step. Receives a list of photo files, extract the date from their name, set the date as EXIF tag, move the file to a directory named after the date, and pass it to the next step.
#!/bin/bash
dossier_ok=~/Desktop/Importes
for filepath in "$@"
do
((n++))
filename=$(basename $filepath)
IFS='_' read -a array <<< "$filename"
year=${array[0]}