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 / 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"
@guillaumegarcia13
guillaumegarcia13 / split-chunk.js
Last active September 2, 2019 10:07
Split long string into concatenated assignment (eg. base64 images)
const CHUNK_SIZE = 80; // put whatever size is relevant here
const CONCAT_OPERATOR = '+'; // put string concatenation operator here
const text = `Very long text would like to be splitted to fit any clumsy editor at there that does only support fixed number of characters per line`;
const regexp = new RegExp('.{1,'+ CHUNK_SIZE+'}', 'g');
const result = '`' + text.match(regexp).join('` ' + CONCAT_OPERATOR + ' \n`') + '`';
// Result with (CHUNK_SIZE=40 and CONCAT_OPERATOR='&&') is:
//
// `Very long text would like to be splitted` &&