Skip to content

Instantly share code, notes, and snippets.

View quilicicf's full-sized avatar
🏐

C​⁠‌​⁠⁠‌​​⁠‍‌‌​​‍‌yprien Q​⁠‌​⁠⁠‌​​⁠‍‌‌​​‍‌uilici quilicicf

🏐
  • Talend
View GitHub Profile
@quilicicf
quilicicf / pausable-gifs.js
Created February 12, 2024 16:04
Play-pause gifs
javascript: (
function () {
/* Inspired by https://codepen.io/hoanghals/pen/dZrWLZ */
/* Uses: https://github.com/buzzfeed/libgif-js */
console.log('Start');
const PAUSED_CLASS = 'paused';
const GIF_CONTROL_CLASS = `gif-control`;
const run = () => {
console.log('Run');
@quilicicf
quilicicf / deleteFolder.js
Created December 11, 2020 16:23
Delete a folder from a GitHub repository using the REST API
/**
* This file shows how to delete a folder from a GitHub repository using the REST v3 API
* Because it is not trivial...
* It was last tested to work on 2020/12/11
*
* The script is supposed to be called like this: node commit.js quilicicf Depotware myBranch
* Where the arguments are in order: the owner of the repository, the name of the repository and
* the name of the branch where the commit will be done.
*
* It assumes there is a valid GitHub personal access token available as environment variable: GITHUB_TOKEN
@quilicicf
quilicicf / commit.js
Last active January 26, 2024 09:26
Commit multiple files at once from a GitHub repository using the REST API
/**
* This file shows how to commit a set of files to a GitHub repository using the REST v3 API
* Because it is not trivial...
* It was last tested to work on 2020/12/10
*
* The script is supposed to be called like this: node commit.js quilicicf Depotware myBranch
* Where the arguments are in order: the owner of the repository, the name of the repository and
* the name of the branch where the commit will be done.
*
* It assumes there is a valid GitHub personal access token available as environment variable: GITHUB_TOKEN
@quilicicf
quilicicf / aes.js
Created May 27, 2020 07:13
NodeJS AES encryption/decryption service with IV
const crypto = require('crypto');
const ALGORITHM = 'aes256';
const DECRYPTED_ENCODING = 'utf8';
const ENCRYPTED_ENCODING = 'hex';
// Makes sure to have a secret with the right size by hashing it and taking a substring of the hash.
// I'm not sure whether this is cryptographically secure, don't use in production.
const hashSecret = secret => crypto
.createHash('sha256')