Skip to content

Instantly share code, notes, and snippets.

View carvilsi's full-sized avatar
🤦‍♀️
I know how to exit vim

Carvilsi [Char] carvilsi

🤦‍♀️
I know how to exit vim
View GitHub Profile
@carvilsi
carvilsi / arducompandup.sh
Created July 21, 2023 11:01
arduino cli compile and upload
#!/bin/sh
# XXX: possible improvements could be adding parameter for PORT and arduino core type
# right now working with UNO and YUN that shares same core
~/bin/arduino-cli compile --fqbn arduino:avr:$1 --log-level debug -v $2 && \
~/bin/arduino-cli upload -p /dev/ttyACM0 --fqbn arduino:avr:$1 --log-level debug -v $2
@carvilsi
carvilsi / gist:5b02864fe1efbb59541d593ac6b79be8
Created July 8, 2023 08:16
git tagging based on package.json version value, node/npm
#!/bin/bash
_vers=v$(node -e "const pckg = require('./package.json'); console.log(pckg.version);")
git tag $_vers
git push origin $_vers
@carvilsi
carvilsi / .ctags
Last active June 14, 2023 08:28 — forked from romainl/.ctags
My ctags config
--langdef=less
--langmap=less:.less
--regex-less=/^[ \t&]*#([A-Za-z0-9_-]+)/\1/i,id,ids/
--regex-less=/^[ \t&]*\.([A-Za-z0-9_-]+)/\1/c,class,classes/
--regex-less=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/
--regex-less=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/
--regex-less=/^[ \t]*(@[A-Za-z0-9_-]+):/\1/v,variable,variables/
--regex-less=/\/\/[ \t]*(FIXME|TODO)[ \t]*\:*(.*)/\1/T,Tag,Tags/
--langdef=scss
@carvilsi
carvilsi / removeNodeModules.sh
Created August 12, 2019 15:17
Remove the node_modules folder to save space for old projects
find . -type d -depth 2 -name "node_modules" -exec rm -rf "{}" \; 2> /dev/null
@carvilsi
carvilsi / bash_profile
Created March 7, 2018 09:25
stuff for bash
# TMUX session auto complete on tab ###############
tat()
{
local session_name="$1"
tmux attach-session -t "$session_name"
if [ $? -ne 0 ]; then
local code_dir="/home/ryandotsmith/src"
local list_of_dirs=( $(find "$code_dir" -name "$session_name" -type d ) )
@carvilsi
carvilsi / vimrc
Last active February 19, 2024 13:03
Vimrc config (plugins: vim-colors-solarized | nerdtree | nerdcommenter | nerdtree-git-plugin | vim-airline)
if has("mouse")
set mouse-=a
endif
"Mappings from Gijs
let mapleader = ","
nnoremap ; :
nnoremap - /
@carvilsi
carvilsi / tmux.conf
Last active March 7, 2018 10:05
tmux configuration
bind r source-file ~/.tmux.conf
#Rename the terminals
set -g set-titles on
set -g set-titles-string '#(whoami)::#h::#(curl ipecho.net/plain;echo)'
#The status bar customization
set -g status-bg colour92
@carvilsi
carvilsi / pidByPortUssage
Created January 5, 2018 15:04
Get PID that is using a port (mac os)
lsof -n -i :9487 | grep LISTEN | awk '/^\w*\s*/ {print $2}'
@carvilsi
carvilsi / check_md5
Last active July 10, 2017 08:16
check the md5 for a file
or="4a706bf3296c814f7d0481681f37289c"; md=$(md5 -q FileToCheck); if [ "$md" == "$or" ]; then echo "OK"; else echo "NoK"; fi
@carvilsi
carvilsi / gist:a33930e2808f961d207151cfea7d5981
Created March 30, 2017 11:36
Remove all buckets on a Minio instance using minio client aka mc
mc ls minio/ | cut -d'B' -f2 | while read x ; do mc rm -r --force minio/$x ; done