Skip to content

Instantly share code, notes, and snippets.

View adelin-b's full-sized avatar
🎯
Focusing

Adelin Berard adelin-b

🎯
Focusing
  • Paris
View GitHub Profile
@adelin-b
adelin-b / live-watcher-demo.cast
Created March 3, 2026 00:09
Live Watcher Demo: Backend Type Change → Frontend Error Detection
{"version":3,"term":{"cols":80,"rows":24,"type":"alacritty"},"timestamp":1772492035,"command":"/bin/bash scripts/demo-live-watcher.sh","title":"Live Watcher: Backend Type Change → Frontend Error","env":{"SHELL":"/bin/zsh"}}
[0.006, "o", "\r\n\u001b[44m\u001b[1;37m \u001b[0m\r\n"]
[0.000, "o", "\u001b[44m\u001b[1;37m LIVE WATCHER DEMO — Backend Type Change → Frontend Error \u001b[0m\r\n\u001b[44m\u001b[1;37m \u001b[0m\r\n\r\n"]
[2.007, "o", "\r\n"]
[0.000, "o", " \u001b[1;35m╭──────────────────────────────────────────────────────────────╮\u001b[0m\r\n"]
[0.000, "o", " \u001b[1;35m│\u001b[0m \u001b[1;36mSTEP 1\u001b[0m \u001b[1;37mVerify types are currently in sync\u001b[0m\r\n"]
[0.000, "o", " \u001b[1;35m╰──────────────────────────────────────────────────────────────╯\u001b[0m\r\n\r\n"]
[0.000, "o", " \u001b[2m$\u001b[0m \u001b[1;32mnpx tsc --noEmit\u001b[0m\r\n\r\n"]
[1
@adelin-b
adelin-b / open-all-links-in-new-tab.js
Last active March 3, 2022 09:50
Click all link on a page matching regex or css selector and open in new tab
@adelin-b
adelin-b / TransformBooleanPipe.ts
Last active August 31, 2021 07:55
Nest js pipe to transform query string boolean into boolean using open api metadata
import { PipeTransform, Injectable, ArgumentMetadata } from "@nestjs/common";
type TrueArgumentMetadata = ArgumentMetadata & {
metatype: { _OPENAPI_METADATA_FACTORY: () => Record<string, any> };
};
@Injectable()
export class TransformBooleanPipe implements PipeTransform<any> {
transform(value: any, { metatype }: TrueArgumentMetadata) {
if (!metatype || !this.toValidate(metatype)) {
@adelin-b
adelin-b / afiaka-dall-e-generation.ipynb
Created August 29, 2021 20:54
Afiaka DALL-E Generation.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adelin-b
adelin-b / spleeter.ipynb
Last active May 10, 2021 19:27
spleeter.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adelin-b
adelin-b / norgtion.org
Last active January 6, 2021 18:39
Notion attempt in orgmode

[1/4] Media

La fin du monde en 80 jours

@adelin-b
adelin-b / ankiToOrg.ts
Last active May 3, 2022 05:05
A script to convert anki file to org file using anki-connect anki plugin and anki-editor for emacs `deno run --allow-net anki.ts "*"` or `deno run --allow-net anki.ts "Deckname"` or inside emacs evil mode `:read !deno run --allow-net anki.ts "*"` WARNING, currently anki-editor break html by escaping it automaticaly when you push the imported decks
const notesInfo = (results: any[]) => ({
action: "notesInfo",
version: 6,
params: {
notes: results,
},
});
const deckname = Deno.args[0] ?? "*";
@adelin-b
adelin-b / OptionsApp.tsx
Last active October 16, 2020 22:45
Auto-generate forms from typescript interface
import * as React from 'react'
import styled from 'styled-components'
import schemaJson from './form.json'
// import Form from '@rjsf/material-ui'
import Form from '@rjsf/core'
// console.log('schema: ', schema)
export interface OptionSettings {
whitelist: string[]
@adelin-b
adelin-b / isDescendant.ts
Last active October 14, 2020 00:12
Check if a dom element is the descendant from another element with matching id
/** Check if a dom element is the descendant from another element with matching id */
export const isDescendant = (element: HTMLElement, parentId: string, depth: number) => {
let isChild = false
if (element.id === parentId) {
//is this the element itself?
isChild = true
}
let iterations = 0
@adelin-b
adelin-b / timeout.ts
Created October 14, 2020 00:01
A timeout that can be awaited
/**
* A timeout that can be awaited
* @param {} ms
*/
export function timeout(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms))
}