Skip to content

Instantly share code, notes, and snippets.

View pil0u's full-sized avatar
⛰️

Pilou pil0u

⛰️
View GitHub Profile

How to manage two GitHub accounts on a Mac

For some reason, you need to manage two different GitHub accounts on your machine - e.g. personal and work.

After a thorough research online along with a test-and-learn approach, the following steps were successful for me.

Assumptions

  • For the sake of this guide, both accounts are called foobar and waldo.
@pil0u
pil0u / aoc_2021_10.py
Created December 10, 2021 09:07
Advent of Code 2021 - Day 10
closers = {
'[': ']',
'(': ')',
'<': '>',
'{': '}'
}
illegals = {
']': 0,
')': 0,
@pil0u
pil0u / aoc_2021_08.py
Created December 8, 2021 08:27
Advent of Code 2021 - Day 8
# Always sort letters (= positions) alphabetically for comparison
def sort_(s):
return "".join(sorted(s))
part_1 = 0
for seg in input_:
signals = seg.split(' | ')[1].split(' ')
for signal in signals:
if len(signal) in [2, 3, 4, 7]:
part_1 += 1
@pil0u
pil0u / 20211003_lobby_des_consciences.md
Created October 3, 2021 20:17
Lobby des Consciences et outils numériques : ma recommandation

Lobby des Consciences et outils numériques

Les problématiques

  1. Recruter et gérer (au sens ressources) 20k personnes
  2. Former et sensibiliser 20k personnes
  3. Coordonner 20k personnes
  4. Communiquer avec 20k personnes
  5. Garder une vision globale (avancement, identifier les points critiques...)
  6. Tout ça avec peu d'outils, simples, faciles à prendre en main, et pas trop chers
@pil0u
pil0u / display_breakpoints.html
Last active August 24, 2021 09:25
Display the current media query breakpoint for Tailwind 2.2.x
<div class="fixed bottom-0 right-0 p-2 bg-white text-black">
<span class="mr-1">Current breakpoint:</span>
<span class="font-bold sm:hidden">default (&lt; 640px)</span>
<span class="font-bold hidden sm:inline md:hidden">sm</span>
<span class="font-bold hidden md:inline lg:hidden">md</span>
<span class="font-bold hidden lg:inline xl:hidden">lg</span>
<span class="font-bold hidden xl:inline 2xl:hidden">xl</span>
<span class="font-bold hidden 2xl:inline">2xl</span>
</div>
@pil0u
pil0u / tailwind.config.js
Created August 24, 2021 09:04
Properly override custom breakpoint Tailwind 2.2.x
const defaultTheme = require("tailwindcss/defaultTheme")
module.exports = {
mode: "jit", // Tailwind v2.1
theme: {
// Usually, you extend your Tailwind properties. Doing so _appends_ your custom classes
// to the default ones.
// The problem with media queries breakpoints is that the order of the classes matters.
// If you want to add breakpoints larger than the defaults, extending is fine.
@pil0u
pil0u / install_postman.sh
Last active March 17, 2024 09:25
Install Postman on Linux through CLI without Snap
# This script basically automates the official Postman installation guide for Linux:
# https://learning.postman.com/docs/getting-started/installation-and-updates/#installing-postman-on-linux
# 32 or 64-bit?
BIT=$(getconf LONG_BIT)
# Download the appropriate version
wget -O ~/postman.tar.gz "https://dl.pstmn.io/download/latest/linux${BIT}"
# Extract the archive in /opt
@pil0u
pil0u / HELLO_WORLD.md
Created February 2, 2021 17:38
It begins.

Hello World! 👋