Skip to content

Instantly share code, notes, and snippets.

View adrienlucbert's full-sized avatar
🚀

Adrien Lucbert adrienlucbert

🚀
View GitHub Profile

Snippets explorer

Lists snippets located in $HOME/.snippets in fzf and copy its content when selected.

Snippets can be any type of file (sql, sh, ...).

animated demo

fzf-cd / fzf-cd-f

fuzzy find a folder and cd into it

Available in a bash version with bindings, or sh function:

fzfcd()
{
  directory="$(find -L . -mindepth 1 -maxdepth 8 -name '\.config' -o -name '\.local' -o \( -name '\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \) -prune -o -type d -print 2>/dev/null | fzf)" || return 1
 cd "$directory" || return 1

Go interpreter

Readline wrapper (history, line-edits, ...) around Yaegi (Go Interpreter).

animated demo

alias goi="rlwrap yaegi"

Can be placed in your $HOME/.bashrc or equivalent.

Git worktree enhanced

Documentation

https://git-scm.com/docs/git-worktree

Using worktrees can be cumbersome and dissuade one from using them, while they're great tools! Here's a helper script that makes using them much easier and hopefully help you adopt worktrees.

Usage

Git watch exec

Execute a command and restart it everytime you checkout or switch git branch.

Usage example

Don't hesitate to shorten the command name for something like gitwatch or gwe as it best fits your workflow.

gitwatchexec "yarn && FORCE_COLOR=true yarn dev:dsp | pino-pretty"

Global pre-commit hooks and forget unwanted prints

Introduction

https://medium.com/@pimterry/introducing-git-confirm-2618bb7cfbed

animated demo

Debug prints and TODOs should often be stripped out of commits, but some slip in when you're not wary. Set-up a pre-commit hook that will look for some blacklisted keywords in your stashed changes and ask you to confirm you want to commit them before you do.

@adrienlucbert
adrienlucbert / unity-webgl-builds.md
Last active March 17, 2022 09:04
Make your Unity WebGL builds run locally

Make your Unity WebGL builds run locally

Build your project

Building your Unity project makes your game playable outside of the Unity Editor. The platform you target during build will determine the platform your game will be playable on.

Here we will focus on building our project for WebGL, to make our game run in almost any browser.