Skip to content

Instantly share code, notes, and snippets.

View jRimbault's full-sized avatar
💭
🦀🐍TS C#

Jacques Rimbault jRimbault

💭
🦀🐍TS C#
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jrimbault on github.
  • I am jrimbault (https://keybase.io/jrimbault) on keybase.
  • I have a public key ASCJbccC_OQIOWePapelONQSO9ZVchrtOOYwJ2ogQ1BS2wo

To claim this, I am signing this object:

@jRimbault
jRimbault / template.sh
Last active May 10, 2018 11:52
Bash script template
#!/usr/bin/env bash
#/ Script Name: template.sh
#/ Author: jRimbault
# Date: 2017-04-06
#/
#/ Description:
#/ This is a template file meant to be used for all my future
#/ bash scripting.
#/
#/ Error Log:
/**
* Trigger callback when the user inputs the konami code
* @param {Function} callback
* @returns {Function} event handler
*/
function konami(callback) {
'use strict'
let kkeys = []
// up,up,down,down,left,right,left,right,B,A
const konami = '38,38,40,40,37,39,37,39,66,65'
@jRimbault
jRimbault / cat.js
Last active December 13, 2018 19:11
#!/usr/bin/env node
const fs = require('fs')
const fileinput = {
/**
* Basic behavior of python's method of the same name
* @returns string[] lines of the file passed as an argument or piped
*/
{"identity":{"name":"Jacques Rimbault","shortName":"jRimbault","description":"Programmeur, 29 ans, -Werror","location":"Paris"},"paragraphs":[{"name":"Experience","id":"experience","elements":[{"aside":{"kind":"date","date":"2018 .. 2019"},"title":"Développeur C# Angular","subTitle":"Société Générale - Corporate and Investment Banking","tags":[["C#","TypeScript","PowerShell"],[".NET","Angular"],["Windows Server"],["GitHub","TeamCity"]]},{"aside":{"kind":"date","date":"2016 .. 2018"},"title":"Développeur PHP","subTitle":"Ministère de l'Intérieur - SG-DSIC","subTitleDescription":"Secrétariat Général - Direction des Systèmes d'Information et Communication","resume":["Développement et maintenance d'une application de l'administration centrale."],"points":[{"description":"Migration de PHP 5.4 vers PHP 7.2","subPoints":[{"description":"Changement de l'API d'interface avec la base de donnée"},{"description":"Refonte sous une forme routeur/controleur"},{"description":"Management des dépendances"}]},{"description":"Fo
@jRimbault
jRimbault / dot.ts
Last active November 21, 2021 12:55
export type DeepDotKey<T> = {
[P in keyof T]: DeepDotKey<T[P]>;
} & (() => string);
/**
* Type safe string builder deep dot notation
*
* @example
* interface Foo {
* dictionary: { [key: string]: { value: number } | undefined };
function partition<T, K extends string | number>(
list: readonly T[],
getKey: (el: T) => K,
) {
const res: { [k in K]?: T[] } = {}
for (const el of list) {
const key = getKey(el)
const target: T[] = res[key] ?? (res[key] = [])
target.push(el)
}
""" Script to quickly generate some classic TTRPG character's attributes """
import argparse
import random
import textwrap
from typing import Iterator
def rolling_methods():
"""
use std::fs;
use std::io;
use std::path::PathBuf;
use structopt::{clap::ArgGroup, StructOpt};
#[derive(Clone, StructOpt, Debug)]
#[structopt(group = ArgGroup::with_name("action").required(true))]
struct Arguments {
/// File containing a G4C key
key_file: PathBuf,
interface ResultMethods<T, E> {
ok(): T | null,
err(): E | null,
unwrap(): T | never,
unwrapErr(): E | never,
expect(message: string): T | never,
expectErr(message: string): E | never,
map<U>(f: (value: T) => U): Result<U, E>,
mapErr<U>(f: (error: E) => U): Result<T, U>,
andThen<U>(f: (value: T) => Result<U, E>): Result<U, E>,