Skip to content

Instantly share code, notes, and snippets.

View NitnekB's full-sized avatar
🚀

Quentin Buirette NitnekB

🚀
View GitHub Profile
@NitnekB
NitnekB / gist:76f31baa89974408b7b38f62b8f23aea
Last active January 17, 2023 20:20
Full setup with ASDF install with Erlang tricks
## SETUP
_Rendez-vous_ on https://brew.sh/ to install brew using command line.
You'll need to install some things before using ASDF (see below).
```bash
brew install coreutils curl git
```
@NitnekB
NitnekB / custom.zsh-theme
Created February 25, 2022 08:39
My personal Oh-My-ZSH theme
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="yellow"; fi
EMOJI_NODE=🔎
EMOJI_RUBY=💎
NODE_MAJOR_LTS="v16"
# We don't use it anymore 😢
#function evaluateDocker() {
# local ref
# if [[ -n ${DOCKER_MACHINE_NAME} ]]; then
@NitnekB
NitnekB / .gitconfig
Last active July 7, 2022 09:28
GIT configuration with shortcuts and aliases
[color]
diff = auto
status = auto
branch = auto
ui = true
[color "status"]
added = green
changed = red bold
untracked = red
@NitnekB
NitnekB / init.lua
Last active February 25, 2022 08:34
Setup Hammerspoon using MiroWindowsManager and some useful shortcuts - https://www.hammerspoon.org/
hs.window.animationDuration = 0.3
hyper = { 'alt', 'ctrl', 'cmd' }
shift_hyper = { 'shift', 'ctrl', 'cmd', 'alt'}
-- ⚠ Plugin MiroWindowsManager requires to be installed
-- See: https://github.com/miromannino/miro-windows-manager
hs.loadSpoon("MiroWindowsManager")
spoon.MiroWindowsManager:bindHotkeys({
up = {hyper, "up"},
@NitnekB
NitnekB / gist:ae5f46242c5e39e25f2d925e41cfe46b
Created February 3, 2022 13:37
Mongo backup & restore
# Use this command to get a backup
mongodump -u <USER> -p <PASSWORD> --port=<PORT> --authenticationDatabase admin -d <DATABASE> -c <COLLECTION>
# Use this command to restore back up (removing the old one)
mongorestore --db <DATABASE> ./<COLLECTION>.bson --drop
@NitnekB
NitnekB / keybase.md
Created December 30, 2019 11:33
Keybase.io

Keybase proof

I hereby claim:

  • I am nitnekb on github.
  • I am nitnekb (https://keybase.io/nitnekb) on keybase.
  • I have a public key ASApLOBuxTB37Os8PHwXDWGVEJRbqJpGgeimS6b4Ou2B8wo

To claim this, I am signing this object:

# Using AREL can be very difficult when we doesn't know how to deal with it.
# But it's a really amazing tool that prevent developers to write SQL queries on RoR project
# Here an example of an average payment widget call
class AveragePayment
# Arel Nodes allows us to directly use Arel::Nodes method
include Arel::Nodes
CompanyPayment = Struct.new(:name, :amount, :bill_count, :average_delay)