Skip to content

Instantly share code, notes, and snippets.

View agumonkey's full-sized avatar

gum agumonkey

  • NONE
  • Dark side of the moon @ ['tkf8-2-1', 'ay21-3', '3263-827']
View GitHub Profile
var defaut = {
tranches: [
{lo:0, hi:9964, per:0},
{lo:9964, hi:27519, per:14},
{lo:27519, hi:73779, per:30},
{lo:73779, hi:156244, per:41},
{lo:156244, hi:999999999999, per:45}
]
}
@agumonkey
agumonkey / impots.js
Last active February 10, 2019 20:00
simulation naive impots 2019
// https://output.jsbin.com/cinefupoda/
// https://jsbin.com/voneyoraka/
var tranches = [
{lo:0, hi:9964, per:0},
{lo:9964, hi:27519, per:14},
{lo:27519, hi:73779, per:30},
{lo:73779, hi:156244, per:41},
@agumonkey
agumonkey / whiteboardCleaner.md
Created February 9, 2019 22:28 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@agumonkey
agumonkey / impots.el
Last active February 10, 2019 00:39
calcul les impots par tranche (fr_FR)
;; -*- lexical-binding: t -*-
(require 'dash)
;; (setq lexical-binding t)
;; from: https://impots.dispofi.fr/bareme-impot/calcul-impot-par-tranche
;; De 0€ à 9964€ 0%
;; De 9964€ à 27519€ 14%
;; De 27519€ à 73779€ 30%
@agumonkey
agumonkey / width.py
Created February 7, 2019 18:59
Trying to make a refill buffer/display .. functionally
class Width:
def __init__(self, w):
self.l = []
self.w = w
def put(self, d):
self.l.append(d)
def __repr__(self):
"""
@agumonkey
agumonkey / cont.py
Created February 4, 2019 18:04
# ~continuations in python
# from: https://www.ps.uni-saarland.de/~duchier/python/continuations.html
# more: https://duckduckgo.com/html?q=continuations%20in%20python
def sumc(x,y,k):
k(x+y)
def mulc(x,y,k):
k(x*y)
def f(x,k):
@agumonkey
agumonkey / dom.py
Last active February 1, 2019 15:52
petit arbre html
from pprint import pprint as pp
from html.parser import HTMLParser
from collections import namedtuple
import requests
#######
# dom #
#######
@agumonkey
agumonkey / spart.ml
Created January 19, 2019 03:58
split on change
; spart [] = []
; spart [1] = [[1]]
; spart [1 1] = [[1 1]]
; spart [1 1 2] = [[1 1] [2]]
s [] = []
s [x] = [x]
s x:xs = sp x:xs x [] []
where sp [] p a r = r
sp x:xs p a r =
@agumonkey
agumonkey / reflection.clj
Created December 18, 2018 01:25
bad helper to show a simpler table of object field members
(require '[clojure.reflect :as re]
'[clojure.pprint :as pp])
(defn j [& l]
"blend of juxt and zip . identity"
(fn [o]
(let [v ((apply juxt l) o)]
(map vector l v))))
(def u (java.net.URL. "https://www.google.com"))
@agumonkey
agumonkey / new-other-buffer.el
Created November 28, 2018 11:37
helper to open a new buffer in the other-window
;;; is there a built-in or idiomatic way to do that ?
(defun new-other-buffer ()
(interactive)
(let ((n (generate-new-buffer-name "new")))
(let ((b (get-buffer-create n)))
;;(split-window-right)
(switch-to-buffer-other-window b))))