Skip to content

Instantly share code, notes, and snippets.

View ewen-lbh's full-sized avatar

Ewen Le Bihan ewen-lbh

View GitHub Profile
@ewen-lbh
ewen-lbh / profiles.jsonc
Last active April 24, 2020 06:55
My Windows Terminal (Preview) profiles
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{2c4de342-38b7-51cf-b940-2309a097f518}",
"profiles": [
{
"guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
"hidden": false,
"name": "Ubuntu",
@ewen-lbh
ewen-lbh / remove_deployments_tab.py
Last active September 14, 2023 01:48
Remove the "Deployments" tab from github.com
"""
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
@ewen-lbh
ewen-lbh / double-click-to-edit-project-note.user.js
Last active May 9, 2020 10:48
userscript: github.com: Double click to edit project note
// ==UserScript==
// @name GitHub: Double click to edit project note
// @version 1
// @grant none
// @include https://github.com/*/*/projects/*
// ==/UserScript==
setTimeout(() => {
allCards = document.querySelectorAll(`.project-card`).forEach(el => {
if (el.dataset.cardType === '["note"]') {
@ewen-lbh
ewen-lbh / theme.rasi
Created May 9, 2020 10:37
Rofi Theme (WIP)
/**
* ROFI Color theme
* User: mbfraga
* Tweaked by: ewen-lbh
* Copyright: Martin B. Fraga
*/
/* global settings and color variables */
* {
maincolor: #de5251;
@ewen-lbh
ewen-lbh / release.py
Created June 23, 2020 07:00
Poetry python package release script
# Requires the following: (I'll try to make this less and less specific until it can become a real CLI)
# - toml ^0.10.1
# - python-dotenv ^0.13.0
# - pygithub ^1.51
# - python ^3.6
# - semantic-version ^2.8.5 (for the constants.py file)
# - a .env file with GITHUB_TOKEN, PYPI_USERNAME and PYPI_PASSWORD set
# (GITHUB_TOKEN is a Personal Access Token)
# - a {package name}/constants.py declaring a version with:
# from semantic_version import Version
@ewen-lbh
ewen-lbh / study_shortids_for_users_and_resources.py
Created August 3, 2020 22:33
A experiment to decide on which shortid formats to use for schoolsyst
import random
from rich import print
from rich.columns import Columns
from rich.console import Console
from rich.table import Table
from schoolsyst_api.database import COLLECTIONS
base59 = lambda len: "".join([random.choice(charset) for _ in range(len)])
@ewen-lbh
ewen-lbh / 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 <hey@ewen.works>"]
[tool.poetry.dependencies]
python = "^3.8"
beautifulsoup4 = "^4.9.3"
@ewen-lbh
ewen-lbh / 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": "⁴",
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
@ewen-lbh
ewen-lbh / 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