Skip to content

Instantly share code, notes, and snippets.

View gwennlbh's full-sized avatar
🐟
さかなあああ〜

Gwenn Le Bihan gwennlbh

🐟
さかなあああ〜
View GitHub Profile
@gwennlbh
gwennlbh / close-issue.rb
Last active April 30, 2022 20:50
A small ruby executable that commits staged changes, computing the commit message so that it closes the issue and follows the Gitmoji convention. Execute it inside of a github repo, or pass owner/repo as an argument to specify a repo explicitly.
#!/usr/bin/env ruby
# Install dependencies:
# - gem install tty-prompt
# - gem install pastel
# - https://cli.github.com
# - npm install --global gitmoji-cli; gitmoji -u
# (just to get the cached list of gitmojis at ~/.gitmoji/gitmojis.json,
# you could write out that file yourself and not install gitmoji-cli)
import (
"strings"
jsoniter "github.com/json-iterator/go"
"unicode"
)
// Usage: put
//
// json := jsoniter.ConfigFastest
// setJSONNamingStrategy(lowerCaseWithUnderscore)
#!/usr/bin/env python3
# TODO overall completion % instead of single-countdown.
"""
Usage:
pomodoro [SESSIONS] [CYCLES] [WORK] [BREAK] [PAUSE]
pomodoro --total-cycles=TOTAL_CYCLES --sessions-of=CYCLES
Arguments:
SESSIONS Number of sessions (cycles then pause) [default: 9999]
CYCLES Number of cycles (work then break) per session: [default: 4]
@gwennlbh
gwennlbh / pkg.go.dev.user.css
Last active May 23, 2021 09:48
pkg.go.dev dark color theme user css
@media (prefers-color-scheme: dark) {
:root {
--gray-10: #202224;
--gray-9: #3e4042;
--gray-8: #555759;
--gray-7: #6e7072;
--gray-6: #848688;
--gray-5: #aaacae;
--gray-4: #c6c8ca;
--gray-3: #dcdee0;
Artist Title
$stdout Over Engineering
1f1n1ty, BilliumMoto Stele, Prophecized
20syl Inertia
20syl Kodama
20syl, Oddisee Ongoing Thing
20syl, Rita J Voices
20syl Swimming Stone
2smokeyy Corn
2XM Inperspect
from enum import Enum
import re
import sys
from time import sleep
from rich import inspect, print, traceback
from bs4 import BeautifulSoup
from typing import Callable, NamedTuple, Optional
import requests
from urllib3.util.url import Url, parse_url, LocationParseError
from urllib.parse import urljoin
@gwennlbh
gwennlbh / 4changallery.bash
Created February 7, 2021 18:26
Image collection from 4chan.org using jq, curl, echo and a $BROWSER
# Replace CHAN with desired 4chan.org/CHAN (eg 'c') and OUTFILE with a .html file to output the gallery to
# Be sure that you have defined a $BROWSER
curl https://a.4cdn.org/CHAN/catalog.json | jq "[.[].threads[] | {title: .sub?, post: (.last_replies[]? | { img: ((.tim? | tostring) + .ext?), comment: .com? })}]" | jq '[.[] | "<h2>\(.title)</h2><img src=https://i.4cdn.org/CHAN/\(.post.img) />"] | join("<hr>")' > OUTFILE && echo "<style>img{max-width:100vw}</style>" >> OUTFILE && $BROWSER OUTFILE
function startproject --description "Start a project."
argparse --name="startproject" \
'd/description=' \
'h/help' \
'p/path=' \
'l/language=' \
'o/owner=' \
'k/kind=!startproject__validate_flag__kind' \
'D/debug' \
-- $argv
@gwennlbh
gwennlbh / alors_oui_bon_boh.py
Created January 7, 2021 15:22
Alors oui bon... booooh.... On va passer en Laplace hein
import re
def to_unicode_superscript(n: int) -> str:
result = str()
for c in str(n):
result += {
"1": "¹",
"2": "²",
"3": "³",
"4": "⁴",
@gwennlbh
gwennlbh / pyproject.toml
Last active October 29, 2020 22:27
pyproject.toml contents for python-poetry/poetry#3307
[tool.poetry]
name = "translator"
version = "0.1.0"
description = ""
authors = ["Ewen Le Bihan <[email protected]>"]
[tool.poetry.dependencies]
python = "^3.8"
beautifulsoup4 = "^4.9.3"