Skip to content

Instantly share code, notes, and snippets.

View rbecheras's full-sized avatar
👋

Rémi Becheras rbecheras

👋
View GitHub Profile

Cheatsheet

Move cursor

command description
ctrl+a Move cursor to the start of the line
ctrl+e Move cursor to the end of the line
ctrl+b Move cursor back one character
ctrl+f Move cursor forward one character
@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 / install.sh
Created June 27, 2017 08:15 — forked from zdne/install.sh
Install phantomjs 1.9.1 x64 on Ubuntu Precise
$ sudo apt-get install libfontconfig
$ cd /usr/local/share
$ sudo wget https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2
$ sudo tar xjf phantomjs-1.9.1-linux-x86_64.tar.bz2
$ sudo ln -s /usr/local/share/phantomjs-1.9.1-linux-x86_64/bin/phantomjs /usr/local/share/phantomjs
$ sudo ln -s /usr/local/share/phantomjs-1.9.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
$ sudo ln -s /usr/local/share/phantomjs-1.9.1-linux-x86_64/bin/phantomjs /usr/bin/phantomjs
@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 / DateFormat.js
Created June 1, 2016 15:32 — forked from eralston/DateFormat.js
Date Format 1.2.3 by Steven Levithan <stevenlevithan.com> - A date formatting library for JavaScript
/*
* Date Format 1.2.3
* (c) 2007-2009 Steven Levithan <stevenlevithan.com>
* MIT license
*
* Includes enhancements by Scott Trenda <scott.trenda.net>
* and Kris Kowal <cixar.com/~kris.kowal/>
*
* Accepts a date, a mask, or a date and a mask.
* Returns a formatted version of the given date.
@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

@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');
}