Skip to content

Instantly share code, notes, and snippets.

View rbecheras's full-sized avatar
👋

Rémi Becheras rbecheras

👋
View GitHub Profile
@rbecheras
rbecheras / mass-rename-replace.sh
Last active January 4, 2018 15:14
A script to rename in mass replacing a string by an other
#!/usr/bin/env bash
# Bash colors
RED="\033[0;31m"
GREEN="\033[0;32m"
ORANGE="\033[0;33m"
YELLOW="\033[1;33m"
NC="\033[0m" # No Color
ERROR="${RED}ERREUR:"
SUCCESS="${GREEN}OK:"
@rbecheras
rbecheras / libecw-build.sh
Created December 12, 2017 09:36 — forked from fritzvd/build.sh
libecw building for gdal
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable # unstable packages
sudo apt-get install build-essential gdal-bin gdal-config libgdal-ecw-src
wget http://meuk.technokrat.nl/libecwj2-3.3-2006-09-06.zip
unzip ~/Downloads/libecwj2-3.3.2006-09-06.zip
cd ~/Downloadslibecwj2-3.3.2006-09-06
./configure
make # wait
make install # or sudo make install
sudo gdal-ecw-build /usr/local
sudo ldconfig
@rbecheras
rbecheras / conv2vmx-ovf.py
Created November 22, 2017 21:26 — forked from eshizhan/conv2vmx-ovf.py
a script that can help import VMs into VMware ESXi from VirtualBox. tested vbox 4.2.18 and ESXi 5.1.
#!/usr/bin/env python
#
# usage:
# conv2vmx-ovf.py some-vm.ovf
#
# ref: http://www.cnblogs.com/eshizhan/p/3332020.html
#
import sys
fn = sys.argv[1]
@rbecheras
rbecheras / xregexp-lookbehind2.js
Created September 12, 2016 08:48 — forked from slevithan/xregexp-lookbehind2.js
Simulating lookbehind in JavaScript (take 2)
// Simulating infinite-length leading lookbehind in JavaScript. Uses XRegExp.
// Captures within lookbehind are not included in match results. Lazy
// repetition in lookbehind may lead to unexpected results.
(function (XRegExp) {
function prepareLb(lb) {
// Allow mode modifier before lookbehind
var parts = /^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*)\)$/.exec(lb);
return {
@rbecheras
rbecheras / appconfig.js
Created May 4, 2016 14:39 — forked from AlexEscalante/appconfig.js
Ionic build with Browserify, development & production builds with sass, es6 transpiling, minification and more. Standard JS, no semicolons.
module.exports = {
default: {
// versionify will replace the following string with the actual version number
BUILD_VERSION: '__VERSION__'
},
development: {
API_URL: 'http://localhost:3000'
},
production: {
API_URL: 'http://acme.com'
@rbecheras
rbecheras / child_monitor.coffee
Created April 11, 2016 22:53 — forked from turtlesoupy/child_monitor.coffee
A node.js process supervisor and a sample use with health checks - see http://blog.argteam.com/coding/hardening-nodejs-production-process-supervisor/
{_} = require 'underscore'
child_process = require 'child_process'
async = require 'async'
healthCheckInterval = 60 * 1000
bounceInterval = 60 * 1000
bounceWait = bounceInterval + 30 * 1000
delayTimeout = (ms, func) -> setTimeout func, ms
class MonitoredChild
@rbecheras
rbecheras / nginxproxy.md
Created April 11, 2016 14:09 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@rbecheras
rbecheras / angularjs-providers-explained.md
Created February 10, 2016 14:29 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@rbecheras
rbecheras / mdxUtil.js
Created February 9, 2016 11:13 — forked from Todd-Werelius/mdxUtil.js
Angular Material Directive to Access Theme Colors
(function() {
angular.module('mdxUtil', ['ngMaterial'])
.directive('mdxPaintFg',function(mdx) {
"use strict";
return {
restrict : 'A',
link : function(scope, element, attributes) {
setRGB(element,'color',mdx.mdxThemeColors,attributes.mdxPaintFg,'mdx-paint-fg');
}