Skip to content

Instantly share code, notes, and snippets.

View rene-d's full-sized avatar
🤘
Let There Be Rock

rene-d rene-d

🤘
Let There Be Rock
  • Thales
  • France
View GitHub Profile
@rene-d
rene-d / md2html.js
Created June 26, 2018 10:58
Convert Markdown to HTML
// rené 06/2018
// Showdown: https://github.com/showdownjs/showdown
// Bootstrap: https://getbootstrap.com/
'use strict';
let fs = require('fs');
let showdown = require('showdown');
let conv = new showdown.Converter();
@rene-d
rene-d / NBLETTR.bas
Created June 26, 2018 20:12
Nombre en lettres (VBA)
'
' Conversion des nombres en lettres
'
' Copyright (c) 1999 René & Guy DEVICHI
'
Option Explicit
Dim dizaines(9) As String
Dim unités(19) As String
@rene-d
rene-d / MColinWhite.bas
Last active June 26, 2018 20:13
Test non paramétrique de Colin-White (VBA)
'
' TEST DE COLIN WHITE
'
' Test non paramétrique de deux échantillons de populations quelconques
'
' référence: NF X 06-065
'
' René DEVICHI 1998
'
Option Explicit
@rene-d
rene-d / md2html.js
Created July 16, 2018 05:37
Markdown to HTML converter with markdown-it and highlight.js
#! /usr/bin/env node
// rené 07/2018
// markdown-it: https://markdown-it.github.io
// highlight.js: https://highlightjs.org/
// Bootstrap: https://getbootstrap.com/
'use strict';
// hack to require() modules in current directory
@rene-d
rene-d / lastused.py
Created July 18, 2018 15:54
Sort subdirectories of a directory by the most recent file dates with them
#! /usr/bin/env python3
import os
import pathlib
import argparse
import datetime
from collections import defaultdict
parser = argparse.ArgumentParser(description='Sort subdirectories by most recent files within them')
parser.add_argument('-v', '--verbose', help="be verbose", action='store_true')
@rene-d
rene-d / pathfind.c
Created October 10, 2018 02:34
get the process path by PID on macOS. example: make pathfind && ./pathfind 86504
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <libproc.h>
int main(int argc, char* argv[])
{
pid_t pid;
int ret;
#! /usr/bin/env python3
# http://ifcuriousthenlearn.com/blog/2015/06/18/center-of-mass/
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
#set plot sizes
plt.rcParams['figure.figsize'] = (10, 2) # (width, height)
plt.rcParams['font.size'] = 20
#! /usr/bin/env python3
import decimal
import re
import math
import readline
RED = "\033[0;31m"
LIGHT_GREEN = "\033[1;32m"
@rene-d
rene-d / cache-expl.py
Last active December 2, 2018 20:24
requests_cache explorer
#! /usr/bin/env python3
import sys
import requests_cache
import logging
import argparse
import os
from urllib.parse import urlparse
import datetime
import email.utils
@rene-d
rene-d / setfdate.py
Last active December 30, 2018 05:58
set file date based on the pattern in the filename
#! /usr/bin/env python3
"""
set file atime and ctime based on the date pattern YYYY[_-]MM[_-]DD in filename
"""
import argparse
import re
import os
import datetime