Skip to content

Instantly share code, notes, and snippets.

@laem
laem / maplibre-gl.css
Last active September 18, 2024 18:21
Globe maplibre-js preversion
.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch
@laem
laem / Init.vim
Last active March 13, 2024 17:28
~/.config/nvim/init.vim
autocmd BufNewFile,BufRead *.tsx set filetype=typescript.tsx
call plug#begin('~/.local/share/nvim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
let g:coc_global_extensions = ['coc-emmet', 'coc-css', 'coc-html', 'coc-json', 'coc-prettier', 'coc-tsserver']
Plug 'ctrlpvim/ctrlp.vim'
Plug 'leafgarland/typescript-vim'
Plug 'dyng/ctrlsf.vim'
Plug 'rakr/vim-one'
C-Em7
C-Em7
C
Em7
Am
Dm
F-G
C-Em7
@laem
laem / HoverDecorator.jsx
Last active May 8, 2017 10:45
React Hover Component Decorator
import React, {Component} from 'react'
export default DecoratedComponent =>
class extends Component {
state = {
hover: false,
}
toggleHover = () =>
this.setState({hover: !this.state.hover})
render() {
@laem
laem / logs
Last active July 10, 2017 10:58
# Cet ensemble de scripts pour obtenir les stats du simulateur d'embauche est complètement archaïque...
# mais on le fait tourner seulement tous les 2-3 mois...
# Sur le serveur
mkdir logs-DATE
sudo su
cp /var/log/nginx/openfisca.* /home/pousse/logs-10juillet2017/
# on compresse les logs pour les transférer sur un autre ordi...
tar -czvf logs-DATE.tar.gz logs-DATE
@laem
laem / net->brut.py
Last active January 20, 2016 16:37
import math
from scipy.optimize import fsolve
def calculate_net_from(brut):
print brut[0]
scenario = tax_benefit_system.new_scenario()
scenario.init_single_entity(
period = "2015-11",
parent1 = dict(
age = 30,
<script src="https://rawgit.com/sgmap/cout-embauche/gh-pages/dist/cout-embauche-widget.js"></script>
@laem
laem / cljtransducers
Created July 1, 2015 12:54
Clojure transducers
https://news.ycombinator.com/item?id=9808021
No, reducers are about reducing things. Transducers are about creating reducers that can be used on arbitrary collection-like things.
Reducers come from the observation that many higher order operations on collections can be built on reduce. You just supply the right reducing function and you get the equivalent to 'map' or 'filter'. This is useful because when you start chaining these higher order functions you can gain performance be replacing the multiple function calls with a single reducer based function.
To take the example from the main docs:
(fold + (filter even? (map inc [1 1 1 2])))
(defmacro forever [& body]
`(while true ~@body))

sudo docker exec -i -t RUNNING_DOCKER_NAME bash

sudo openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/cozy/server.key -out /etc/cozy/server.crt -days 365 -subj '/CN=DOMAIN_NAME'