Skip to content

Instantly share code, notes, and snippets.

View ccjmne's full-sized avatar
⚗️
Experimenting

Eric NICOLAS ccjmne

⚗️
Experimenting
View GitHub Profile
@ccjmne
ccjmne / secure-chat.txt
Last active June 17, 2024 22:26
secure-chat
1. Create a user for your friend
sudo mkdir -p /home/your-friend
sudo touch /home/your-friend/log
sudo tee /home/your-friend/chat > /dev/null <<-'EOF'
trap exit SIGINT
tail -f /home/your-friend/log &
while IFS=$'\n' read -r line; do
[[ -n "$line" ]] && echo "$USER: $line" >> /home/your-friend/log
done
@ccjmne
ccjmne / do-the-thing.sh
Last active June 17, 2024 17:14
git-filter-repo
# Move the "creditcardpayment" directory to the root of the repository
# NB: the forward slash at the end of the path is important (preceding the colon),
#see https://github.com/newren/git-filter-repo/issues/125#issuecomment-1016980260
git-filter-repo --path creditcardpayment/ --path-rename=creditcardpayment/:
# Then, probably "git add remote" and push to the new repository
# Clone a single branch in its current state:
git clone git@gitlab.build-unite.unite.eu:procurement-platform/mercateo.git --depth 1 --no-checkout mo --single-branch --branch ITHD-89192-refactor-cc-payment-update-consumers
@ccjmne
ccjmne / the-joke
Last active March 14, 2024 23:47
Double factorial joke
Recipe:
=======
let x be a positive integer
let a be: 2x!! - 2x
let b be: 2x!! - 4x
For a most tasteful joke, let x be 5, 6, or 7.
Contemplate the reality that the following two statements are true:
@ccjmne
ccjmne / lolesports-wait-for-live.user.js
Last active October 10, 2023 16:37
Refresh LoL Esports' schedule page until the Worlds show begins!
// ==UserScript==
// @name Watch the Worlds show as soon as it goes live
// @namespace http://tampermonkey.net/
// @version 1.1.0
// @description Refresh LoL Esports' schedule page until the Worlds show begins!
// @author Eric NICOLAS (ccjmne) <ccjmne@gmail.com>
// @match https://lolesports.com/schedule*
// @downloadUrl https://gist.githubusercontent.com/ccjmne/a14bac46ead2af80823ba5f162569c3a/raw/lolesports-wait-for-live.user.js
// @updateurl https://gist.githubusercontent.com/ccjmne/a14bac46ead2af80823ba5f162569c3a/raw/lolesports-wait-for-live.user.js
// @icon https://www.google.com/s2/favicons?sz=64&domain=lolesports.com
@ccjmne
ccjmne / keep-presence.ahk
Last active October 8, 2023 21:11
AutoHotKey script for an equivalent to `keep-presence -cs .1`
; Author: Eric NICOLAS (ccjmne) <ccjmne@gmail.com>
; Version: 1.0.0
; Repository: https://gist.github.com/ccjmne/c2ac26ffc34ac2e1a1cbf4718c26506b
; Description
; ===========
; Like `keep-presence -cs 1`
; Ctrl-Alt-P to toggle on or off
; Automatic start-up
@ccjmne
ccjmne / unicode-input.ahk
Last active August 29, 2023 19:39
AutoHotKey script for Unicode input, Ubuntu-like
; Author: Eric NICOLAS (ccjmne) <ccjmne@gmail.com>
; Version: 1.2.3
; Repository: https://gist.github.com/ccjmne/518f70633a5f92dfacb8b9040cc106ee
; Description
; ===========
; Input unicode characters with ease, the same way Ubuntu would enable you to.
; Ctrl-Shift-U, 2013, Enter and voilà, a beautiful en-dash for your value ranges :)
; Usage
@ccjmne
ccjmne / README.md
Last active August 10, 2023 11:30
Laufzettels search-and-replace widget for Unite
@ccjmne
ccjmne / evo-redirect-tampermonkey-script.js
Last active July 19, 2023 20:35
EVO Mock Redirect TamperMonkey Script for Unite
(()=>{"use strict";const e={ECB:0,CBC:1},a={PKCS5:0,ONE_AND_ZEROS:1,LAST_BYTE:2,NULL:3,SPACES:4},c={STRING:0,UINT8_ARRAY:1};function d(e){return e>>>0}function f(e,a){return d(e^a)}function b(e,a){return d(e+a|0)}function t(e,a,c,f){return d(e<<24|a<<16|c<<8|f)}function r(e){return[e>>>24&255,e>>>16&255,e>>>8&255,255&e]}function n(e){return"string"==typeof e}function s(e){return"object"==typeof e&&"byteLength"in e}function o(e){return n(e)||s(e)}function i(e,a){let c=!1;return Object.keys(e).forEach((d=>{e[d]===a&&(c=!0)})),c}function l(e){if(n(e))return(new TextEncoder).encode(e);if(s(e))return new Uint8Array(e);throw new Error("Unsupported type")}const u="243f6a8885a308d313198a2e03707344a4093822299f31d0082efa98ec4e6c89452821e638d01377be5466cf34e90c6cc0ac29b7c97c50dd3f84d5b5b54709179216d5d98979fb1bd1310ba698dfb5ac2ffd72dbd01adfb7b8e1afed6a267e96ba7c9045f12c7f9924a19947b3916cf70801f2e2858efc16636920d871574e69a458fea3f4933d7e0d95748f728eb658718bcd5882154aee7b54a41dc25a59b59c30d5392af26013c5d1b023286085f0ca4179
@ccjmne
ccjmne / Transactions.java
Last active June 23, 2023 08:54
Alternatives to the Autocloseable trick
// The current state:
try (BuyerDataState buyerDataState = this.notifyBuyerUpdateManager.beginAddressUpdate(buyer.getLegalEntityId())) {
return buyerHandler.updateBuyer(buyer);
}
private static class NotifyBuyerUpdateManager {
public static BuyerDataState beginAddressUpdate() {
final BuyerData currentBuyerData = loadBuyerData();
@ccjmne
ccjmne / unite-logo.svg
Last active March 31, 2023 23:10
Animated Unite logo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.