Skip to content

Instantly share code, notes, and snippets.

View guillaumegarcia13's full-sized avatar
💭
Building awesome things 🚀

GARCIA Guillaume guillaumegarcia13

💭
Building awesome things 🚀
View GitHub Profile
@guillaumegarcia13
guillaumegarcia13 / port_forward.bat
Last active August 25, 2016 18:08
SSH Tunnel with Port Forwarding
:: Use this Windows BATCH file to perform SSH Tunneling with Port Forwarding to your local PC
::
:: Explanations of the command line switches
:: -ssh Connects through SSH
:: -P Port to which you connect on the remote server
:: -pw Password to connect with
:: -L Forwards local portal to remote destination
:: -N (always at the end) Do NOT start a shell
:: Example

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
import java.util.Map.Entry;
import java.util.TreeMap;
// See http://stackoverflow.com/a/13400317/611182
public class Main {
private static TreeMap<Double, String> m = new TreeMap<Double, String>();
static {
m.put(1.0, "A");
m.put(2.9, null);
@guillaumegarcia13
guillaumegarcia13 / postgres-cheatsheet.md
Created June 10, 2016 16:13 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

@guillaumegarcia13
guillaumegarcia13 / get-watchers.js
Created June 9, 2016 09:11 — forked from kentcdodds/get-watchers.js
Get Watchers of element and its children
function getWatchers(root) {
root = angular.element(root || document.documentElement);
var watcherCount = 0;
function getElemWatchers(element) {
var isolateWatchers = getWatchersFromScope(element.data().$isolateScope);
var scopeWatchers = getWatchersFromScope(element.data().$scope);
var watchers = scopeWatchers.concat(isolateWatchers);
angular.forEach(element.children(), function (childElement) {
watchers = watchers.concat(getElemWatchers(angular.element(childElement)));
@guillaumegarcia13
guillaumegarcia13 / Apprendre JS correctement.md
Created April 19, 2016 09:54 — forked from tdd/Apprendre JS correctement.md
Quelques ressources valables pour (ré)apprendre JS correctement
@guillaumegarcia13
guillaumegarcia13 / _contrast_mixin.scss
Created November 5, 2015 15:23 — forked from aaronrussell/_contrast_mixin.scss
Sass function and mixin for setting contrasting background and foreground colors
$contrasted-default-dark: #000;
$contrasted-default-light: #fff;
@mixin contrasted($bg, $dark:$contrasted-default-dark, $light:$contrasted-default-light){
background-color: $bg;
color: get_contrast_yiq($bg, $dark, $light);
}
@guillaumegarcia13
guillaumegarcia13 / index.html
Created January 27, 2015 11:17
Flattened DataSet bound to OData Entity with filter // source http://jsbin.com/yudeza
<html>
<!-- Original: http://www.wenda.io/questions/2410986/sapui5-showing-pie-chart-or-bar-chart-using-odata-service-from-hana-db.html -->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Flattened DataSet bound to OData Entity with filter</title>
<link rel="stylesheet" type="text/css" href="">
<script id="sap-ui-bootstrap" src="https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js" type="text/javascript"
* {
box-sizing: border-box;
margin: 0;
padding: 0;
border: 0;
box-shadow: none;
outline: none;
}
html, body { height: 100%; }