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 / sample.html
Created September 4, 2017 15:53
Angular 4 ng-template & ng-container with parameters
<ng-template #followingpost let-author="author" let-age="age" let-text="text" let-badge="badge">
<div class="container-fluid">
<div class="card">
<div class="header">
<h4 class="title">{{ author }}</h4>
<p class="category">il y a {{ age }} jours</p>
</div>
<div class="content" [innerHTML]="text">
</div>
@guillaumegarcia13
guillaumegarcia13 / post.js
Last active June 28, 2017 14:30
Add stats to all of your posts in LinkedIn
// PURPOSE
//----------
// On LinkedIn, you may have your stats under the cards related to your posts but sometimes you DON'T
// This snippet is here to solve this by being run in your console on: https://www.linkedin.com/in/{{user}}/recent-activity/ page
// Limitations:
// - loading is lazy so when you have to re-run the snippet after scrolling
// - only on 'Post' activity and not on 'Like' activity
// - does not detect existing stats
# Consume GraphQL at: https://developer.github.com/v4/explorer/
query ($login: String!, $repo: String!) {
organization(login: $login) {
name
url
repository(name: $repo) {
name
watchers(first: 100) {
nodes {
public class JSONUtils {
//-------------
// DATA
//-------------
static public ObjectMapper objectMapper = new ObjectMapper();
//-------------
// METHODS
@guillaumegarcia13
guillaumegarcia13 / html_forms_cheatsheet.md
Created April 4, 2017 12:21
HTML forms and input tags cheatsheet. All you need to know to write every HTML form possible, including links to good resources on HTML and the new HTML5 form and input options...

HTML Forms

In order that you never go to W3Schools (never go there), here is a basic cheat sheet for writing simple HTML forms.

This is culled from a few sources, [the most important being MDN][MDN]. MDN (the Mozilla Developer Network) should be seen as "the docs" when you are having an issue with HTML.

var script = document.createElement("script");
script.setAttribute("src", "//code.jquery.com/jquery-latest.min.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
@guillaumegarcia13
guillaumegarcia13 / count.cypher
Created December 29, 2016 16:51
Neo4j: Count all relations per node types
MATCH (n)-[r]->(m)
WITH HEAD(LABELS(n)) AS label_n, type(r) as type_r, HEAD(LABELS(m)) AS label_m
RETURN type_r, label_n, label_m, COUNT(*)
ORDER BY type_r
@guillaumegarcia13
guillaumegarcia13 / gist:a334b29b294ec587f9d5f13118c70a66
Created December 8, 2016 11:36 — forked from devinus/gist:415179
Turn CSS rules into inline style attributes using jQuery
(function ($) {
var rules = document.styleSheets[document.styleSheets.length-1].cssRules;
for (var idx = 0, len = rules.length; idx < len; idx++) {
$(rules[idx].selectorText).each(function (i, elem) {
elem.style.cssText += rules[idx].style.cssText;
});
}
$('style').remove();
$('script').remove();
})(jQuery);
@guillaumegarcia13
guillaumegarcia13 / build.gradle
Created November 20, 2016 14:05
Gradle on WIndows: Error 206
task bootRun206_clean(dependsOn: clean) { }
task bootRun206_jar(dependsOn: jar) { }
task bootRun206_bootRepackage(dependsOn: bootRepackage) { }
task bootRun206_run(type: JavaExec) {
description = "Circumvent the error 206 on Windows due to long command line"
classpath = files('build/libs/<output name>.jar')
classpath += sourceSets.main.runtimeClasspath
main = "com.example.<main class>"
}
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class