This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// Convert a modules on the pattern | |
// export default { | |
// fnAName: (bla) => {}, | |
// fnBName: (bla) => {}, | |
// } | |
// to | |
// export const fnAName = (bla) => | |
// export const fnBName = (bla) => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Create or edit userChrome.css in your Firefox profile folder, | |
typically found on Linux at ~/.mozilla/firefox/[your firefox profile folder]/chrome/userChrome.css | |
*/ | |
.urlbarView-row[label]{ | |
margin-block-start: 0 !important; | |
} | |
.urlbarView-row[label]::before{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Assuming that the workflow yaml file sets the following | |
# env: | |
# WD_CONSUMER_KEY: ${{ secrets.WD_CONSUMER_KEY }} | |
# WD_CONSUMER_SECRET: ${{ secrets.WD_CONSUMER_SECRET }} | |
# WD_TOKEN: ${{ secrets.WD_TOKEN }} | |
# WD_TOKEN_SECRET: ${{ secrets.WD_TOKEN_SECRET }} | |
echo "{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// Handlebars and Svelte templates are quite similar (that is, looking a lot like plain HTML), | |
// so converting from Handlebars to Svelte is mostly a matter of converting handlebars helpers argument syntax | |
// into Svelte JS-based syntax, and importing the helper functions. | |
// WARNING: if you have been using named arguments in Handlebars (a.k.a. 'hash' arguments), | |
// the helper function interface will need to be updated (or the arguments passed as `{ hash: argsObject }`) | |
// STATUS: WIP. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use your username and password to get session cookies | |
INV_USERNAME=foo | |
INV_PASSWORD=bar | |
INV_SESSION_COOKIES=$(curl -v 'https://inventaire.io/api/auth?action=login' -d "{\"username\":\"$INV_USERNAME\",\"password\":\"$INV_PASSWORD\"}" 2>&1 | grep 'Set-Cookie: inventaire:session' | awk '{print $3}' | xargs echo) | |
add_claim(){ | |
uri=$1 | |
property=$2 | |
value=$3 | |
curl -s -XPUT "https://inventaire.io/api/entities?action=update-claim" -H "Cookie: $INV_SESSION_COOKIES" -H "Content-Type: application/json" -d "{\"uri\":\"${uri}\",\"property\":\"${property}\",\"new-value\":\"${value}\"}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# A script to keep a list of the hashes by which a commit was previously known | |
# Adapted from https://stackoverflow.com/a/54352290/3324977 | |
# Installation: | |
# - copy this script to a directory in your $PATH | |
# - make it executable: | |
# chmod +x ./update_commit_previous_hashes_list | |
# - it should now be accessible from any directory, which can be checked like this: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Display changes made to a file in all the active branches | |
if [[ $1 == "" ]] ; then | |
echo "branches-diff <files...|folders...>" | |
exit 1 | |
fi | |
branches_on_origin_remote_with_last_commit_less_than_a_year_ago(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Initialize the array of favs | |
source ~/.favs | |
# Create an alias for each of the favs | |
for key in $favs | |
do | |
directory="$favs[$key]" | |
alias $key="cd $directory" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// Environment | |
// ------------------ | |
// NodeJS: v12.14.0 | |
// CPU: 2.50GHz | |
// arrays length = 1000 (that is, sorting 1000^2 elements) | |
// Results | |
// ------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// To be run after bulk-decaffeinate is done | |
// bulk-decaffeinate convert --num-workers 8 --config ~/bulk-decaffeinate.config.js | |
// cleanup(){ | |
// decaffeinate_cleanup.js "$@" && npm run lint-fix "$@" | |
// } | |
// | |
// cleanup **/*.js |
NewerOlder