Skip to content

Instantly share code, notes, and snippets.

View benavern's full-sized avatar
🙈
Still trying to be someone

Benjamin CARADEUC benavern

🙈
Still trying to be someone
View GitHub Profile
@benavern
benavern / safeJsonReplacer.js
Created April 8, 2020 09:27
a JSON.stringify replacer that prevents from circular structures & un-stringify-able properties
/**
* Creates a formatter for JSON.stringify that prevents from circular structures and not stringify-able values
*/
function safeJsonReplacer() {
const seen = new Set();
return (key, val) => {
// prevent from circular structures
if (typeof val === 'object' && val !== null) {
@benavern
benavern / quicktile.cfg
Created April 6, 2020 22:01
My personal quickTile conf
[general]
cfg_schema = 1
ModMask = <Ctrl><Alt>
MovementsWrap = False
ColumnCount = 3
[keys]
Insert = maximize
Prior = top-right
@benavern
benavern / .aliases
Last active April 9, 2020 12:40
my usual aliases
# simple aliases
alias cdw='cd ~/Workspace' # open workspace directory
alias n='ntl -i'
# functions
function mkcd () { mkdir -p "$1"; cd "$1"; } # create & open a directory
@benavern
benavern / .vim
Last active September 24, 2019 12:46
my vim configuration
# this is the content of my ~/.vim/ directory
$ tree -L 2 ~/.vim
/home/zezen/.vim
├── autoload
│   └── pathogen.vim
├── bundle
│   ├── emmet-vim
│   ├── nerdtree
│   ├── vim-airline
@benavern
benavern / README.md
Last active November 4, 2018 23:44
3 & 4 fingers gestures for elementaryos
git clone http://github.com/bulletmark/libinput-gestures
cd libinput-gestures
sudo make install
sudo apt-get install xdotool wmctrl libinput-tools
sudo gpasswd -a $USER input
libinput-gestures-setup autostart

copy the conf file to ~/.config/

@benavern
benavern / .antigenrc
Last active September 23, 2019 22:29
dotfiles
# Load the oh-my-zsh's library.
antigen use oh-my-zsh
# Bundles from the default repo (robbyrussell's oh-my-zsh)
antigen bundle git
antigen bundle pip
antigen bundle docker
antigen bundle nvm
antigen bundle npm
@benavern
benavern / Home.vue
Last active September 1, 2017 12:52
Very simple Vue plugin for translations
<template>
<div>
<div>{{ $t('simple') }}</div>
<div><button @click="test = 'simple'">{{$t(test)}}</button></div>
<div>{{ $t('complicated', {nb: 3, things, feeling: 'bon', noneed: 'nothing'}) }}</div>
<div>{{ fromData }}</div>
<div><pre>{{ $t('plainObject') }}</pre></div>
</div>
</template>