Skip to content

Instantly share code, notes, and snippets.

View AntoineDrouhin's full-sized avatar

Antoine Drouhin AntoineDrouhin

  • Paris - France
View GitHub Profile
How to Draw: Drawing and Sketchin... ░░░░░░░░░░░░░ 0%
Database Internals: A deep-dive i... ░░░░░░░░░░░░░ 0%
Designing Data-Intensive Applicat... ██████▌░░░░░░ 50%
export type ReplaceBigIntByString<T> = {
[K in keyof T]:
T[K] extends object
? ReplaceBigIntByString<T[K]>
: T[K] extends BigInt
? string
: T[K]
}
// usage : await sleep(1000)
function sleep(milliseconds: number) {
return new Promise(resolve => setTimeout(resolve, milliseconds))
}
export { sleep }
@AntoineDrouhin
AntoineDrouhin / stringify.ts
Created January 22, 2019 12:45
stringify recursive object
/**
* Wrapper for json.stringify that will prevent circular reference error
* and format the output with the provided space
* @param input any
*/
export default function stringify(input: any) {
const seen: Set<any> = new Set<any>()
return JSON.stringify(
input,
(_, value) => {
@AntoineDrouhin
AntoineDrouhin / .gitconfig
Last active April 30, 2019 08:40
Global git config
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[user]
email = [email protected]
name = antoine drouhin
[core]
editor = vim
@AntoineDrouhin
AntoineDrouhin / .vimrc
Created October 19, 2018 17:31
.vimrc
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin()
Plug 'sonph/onehalf', {'rtp': 'vim/'}
{"lastUpload":"2021-01-07T17:48:23.696Z","extensionVersion":"v3.4.3"}
@AntoineDrouhin
AntoineDrouhin / main.pl
Last active November 21, 2018 14:48
Paris1 Product line course / Prolog / Printer Product Line Model.
printer(L) :-
L= [
Root,
% Print functions
Print,
IncPrint,
LazerPrint,
IncBnW,