Skip to content

Instantly share code, notes, and snippets.

Avatar
λ

jRimbault jRimbault

λ
View GitHub Profile
View codech.rs
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,
View dnd_attributes.py
""" Script to quickly generate some classic TTRPG character's attributes """
import argparse
import random
import textwrap
from typing import Iterator
def rolling_methods():
"""
View partition.ts
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)
}
View dot.ts
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 };
View cat.js
#!/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
*/
View konami.js
/**
* 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 / template.sh
Last active May 10, 2018
Bash script template
View template.sh
#!/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:
View keybase.md

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:

You can’t perform that action at this time.