Skip to content

Instantly share code, notes, and snippets.

View cmizony's full-sized avatar

Camille Mizony cmizony

View GitHub Profile
@cmizony
cmizony / domToImg.js
Created July 27, 2024 18:12
Convert DOM object to ImageB
// ____ ___ __ __ _ ___ __ __ ____
// | _ \ / _ \| \/ | | |_ ___ |_ _| \/ |/ ___|
// | | | | | | | |\/| | | __/ _ \ | || |\/| | | _
// | |_| | |_| | | | | | || (_) | | || | | | |_| |
// |____/ \___/|_| |_| \__\___/ |___|_| |_|\____|
function domToImg (dom, size) {
const canvas = document.createElement('canvas')
canvas.height= size ?? 100
canvas.width= size ??100
# ____ __ __ ___ ________ _ ___ __ ____
# / ___| \/ |_ _|__ / _ \| \ | \ \ / / / ___| ___ _ __ ___ ___ _ __ _ __ ___
#| | | |\/| || | / / | | | \| |\ V / _____ \___ \ / __| '__/ _ \/ _ \ '_ \| '__/ __|
#| |___| | | || | / /| |_| | |\ | | | |_____| _ ___) | (__| | | __/ __/ | | | | | (__
# \____|_| |_|___/____\___/|_| \_| |_| (_)____/ \___|_| \___|\___|_| |_|_| \___|
startup_message off
# Window list at the bottom.
@cmizony
cmizony / ctags
Last active September 6, 2015 04:12
--exclude=.git
--exclude=node_modules
--exclude=bower_cache
--exclude=bower_components
--exclude=target
--exclude=build
--exclude=dist
--exclude=doc
--exclude=tmp
@cmizony
cmizony / initLayoutBottom.sh
Created August 22, 2015 23:31
Example of automated multiplexer session
#!/bin/bash
#
# ____ __ __ ___ ________ _ ___ __ ____
# / ___| \/ |_ _|__ / _ \| \ | \ \ / / / ___| ___ _ __ ___ ___ _ __
# | | | |\/| || | / / | | | \| |\ V / _____ \___ \ / __| '__/ _ \/ _ \ '_ \
# | |___| | | || | / /| |_| | |\ | | | |_____| ___) | (__| | | __/ __/ | | |
# \____|_| |_|___/____\___/|_| \_| |_| |____/ \___|_| \___|\___|_| |_|
#
#
# Create simple screen layout (bottom split)
@cmizony
cmizony / vimrc
Last active February 10, 2024 20:58
Vim - Opinionated configuration
" _____ __ __ _____ __________ _ ___ __ _
" / ____| \/ |_ _|___ / __ \| \ | \ \ / / (_)
" | | | \ / | | | / / | | | \| |\ \_/ / ______ __ ___ _ __ ___ _ __ ___
" | | | |\/| | | | / /| | | | . ` | \ / |______| \ \ / / | '_ ` _ \| '__/ __|
" | |____| | | |_| |_ / /_| |__| | |\ | | | \ V /| | | | | | | | | (__
" \_____|_| |_|_____/_____\____/|_| \_| |_| \_/ |_|_| |_| |_|_| \___|
"
"
" 1. Easy navigation in .vimrc:
" Use <Leader>ig to view indentation guides
@cmizony
cmizony / watcher.sh
Last active September 6, 2015 04:13
#!/bin/bash
# ____ __ __ ___ ________ _ ___ __ __ __ _ _
# / ___| \/ |_ _|__ / _ \| \ | \ \ / / \ \ / /_ _| |_ ___| |__ ___ _ __
# | | | |\/| || | / / | | | \| |\ V / _____ \ \ /\ / / _` | __/ __| '_ \ / _ \ '__|
# | |___| | | || | / /| |_| | |\ | | | |_____| \ V V / (_| | || (__| | | | __/ |
# \____|_| |_|___/____\___/|_| \_| |_| \_/\_/ \__,_|\__\___|_| |_|\___|_|
#
#
# Linux: apt-get install inotifywait
#
@cmizony
cmizony / ramer-douglas-peucker.js
Last active December 26, 2015 19:03
Ramer Douglas Peucker
// ____ __ __ ___ ________ _ ___ __
// / ___| \/ |_ _|__ / _ \| \ | \ \ / /
// | | | |\/| || | / / | | | \| |\ V /
// | |___| | | || | / /| |_| | |\ | | |
// \____|_| |_|___/____\___/|_| \_| |_|
/**
* @method ramerDouglasPeucker
*
@cmizony
cmizony / chart_skeleton.js
Last active August 29, 2015 14:16
D3 chart skeleton using closures and getter-setters config methods
// ____ __ __ ___ ________ _ ___ __ ____ _____ _
// / ___| \/ |_ _|__ / _ \| \ | \ \ / / | _ \___ / (_)___
// | | | |\/| || | / / | | | \| |\ V / _____ | | | ||_ \ | / __|
// | |___| | | || | / /| |_| | |\ | | | |_____| | |_| |__) | | \__ \
// \____|_| |_|___/____\___/|_| \_| |_| |____/____(_)/ |___/
// |__/
/**
* @method getSkeletonChart
*