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 / suivi-votes-loi-Duplomb
Created July 18, 2025 08:13
πŸ—³οΈ Suivi du nombre de votes de la pΓ©tition contre la loi Duplomb
(function(){if(!window.pc)window.pc={d:null,l:0,i:false};const c=window.pc,n=Date.now(),m=5*60*1000,r=(n-c.l)>=m;if(r&&!c.i){c.i=true;(async()=>{try{const res=await fetch('https://petitions.assemblee-nationale.fr/initiatives/i-3014');const html=await res.text();const doc=new DOMParser().parseFromString(html,'text/html');const el=doc.querySelector('#initiative-3014-votes-count > div.progress__bar__title > span.progress__bar__number');c.d={v:el?.textContent?.trim()||'N/A',t:new Date().toLocaleTimeString(),s:true};c.l=n;}catch(e){c.d={v:'Error',t:new Date().toLocaleTimeString(),s:false,e:e.message};c.l=n;}finally{c.i=false;}})();}return c.i?`πŸ”„ Loading...`:(c.d?`πŸ—³οΈ ${c.d.v} | ${c.d.t} | Next: ${new Date(c.l+m).toLocaleTimeString()}`:`⏳ Init...`);})();
@guillaumegarcia13
guillaumegarcia13 / rotate_emoji.css
Created October 30, 2021 08:06
Rotating emoji CSS
/* Animating with globe emoji */
@keyframes rotateEmoji {
0% { content: "\01F30D"; }
33% { content: "\01F30E"; }
66% { content: "\01F30F"; }
}
.my-own-tile .nepTileTitle .nepTileClickable::before {
content: "\01F30D";
}
.my-own-tile:hover .nepTileTitle .nepTileClickable::before {
@guillaumegarcia13
guillaumegarcia13 / elementor_carousel_custom_link.js
Created February 1, 2021 11:28
Elementor - Custom external links for Image Carousel
@guillaumegarcia13
guillaumegarcia13 / linkedin_profiles.js
Last active December 1, 2020 09:40
Retrieve all LinkedIn profiles of people leaving a comment
/*====================================================================================================================
* Author: Guillaume GARCIA (https://www.linkedin.com/in/guillaumegarcia/)
* Date : 30-november-2020
*
* Usage
* -----
*
* Go to a LinkedIn post URL
* such as: https://www.linkedin.com/feed/update/urn:li:activity:6738104526265446400/
* Open Chrome DevTools
@guillaumegarcia13
guillaumegarcia13 / gmail_to_slack.js
Created October 30, 2020 10:38 — forked from andrewmwilson/gmail_to_slack.js
Google Apps Script: Send Gmail emails to Slack
// You will also need to create a gmail filter to add the 'send-to-slack' label
// to any emails you want sent to slack
function sendEmailsToSlack() {
var label = GmailApp.getUserLabelByName('send-to-slack');
var messages = [];
var threads = label.getThreads();
for (var i = 0; i < threads.length; i++) {
messages = messages.concat(threads[i].getMessages())
@guillaumegarcia13
guillaumegarcia13 / inspect.js
Created October 16, 2020 09:58
Inspect object and return getter methods in console.table
var inspect = function(ctrl, prototypeLevel = 1) {
let output = [];
let level = prototypeLevel;
// local auxiliary helper
const _fillDictionary = (subObj, depth, originalObj = subObj) => {
Object.keys(subObj).forEach(key => {
// only consider 'getter' and catch any error (such as mandatory parameters)
if (key.startsWith('get') && typeof originalObj[key] === 'function') {
try {
@guillaumegarcia13
guillaumegarcia13 / angular-add-to-home-screen.component.ts
Created May 31, 2020 20:54 — forked from pnutmath/angular-add-to-home-screen.component.ts
Angular - Add to home screen POC (app.component.ts)
import { Component, HostListener } from '@angular/core';
@Component({
selector: 'app-root',
template: '<button (click)="addToHomeScreen()" *ngIf="showButton">Add to Home Scree</button>',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
deferredPrompt: any;
@guillaumegarcia13
guillaumegarcia13 / reduce.js
Last active November 5, 2019 15:32
Reduce compilation (rewrite some classic collection methods using reduce)
/* From: https://medium.com/@hkairi/reduce-le-couteau-suisse-du-d%C3%A9veloppeur-javascript-8cf4b6f98304
1. min()
2. max()
3. length()
4. map()
5. filter()
6. reverse()
7. unique()
8. take()
9. any()
@guillaumegarcia13
guillaumegarcia13 / sleep.js
Created September 18, 2019 09:54
sleep (await version)
var sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
// Usage
// within an 'async' function
await sleep(2000);
// And without async?
// scenarios like the following do not work unfortunately
console.log('Wait for 5s...');
(async function() {
<!DOCTYPE html>
<html><head>
<meta name="description" content="SAPUI5 Simpleform with multiple controls " />
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<title>SAPUI5 List Example with dynamic css gbvaibhav</title>
<script src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"