Skip to content

Instantly share code, notes, and snippets.

View eutobias's full-sized avatar

Tobias Taurian Viana eutobias

View GitHub Profile
@eutobias
eutobias / .git-aliases
Last active October 29, 2023 19:10
git aliases
[alias]
lg = log --all --graph --decorate --oneline --abbrev-commit
st = status
co = checkout
cob = checkout -b
c = !git add -A && git commit -m
save = !git add -A && git commit -m 'SAVEPOINT'`
@eutobias
eutobias / eutobias.zsh-theme
Last active July 18, 2021 22:15
.gitcolors converted to ohMyZsh theme
# Determine the branch/state information for this git repository.
function set_git_branch {
# Capture the output of the "git status" command.
git_status="$(git status 2> /dev/null)"
# Set color based on clean/staged/dirty.
if [[ ${git_status} =~ "working tree clean" ]]; then
state="%{$terminfo[bold]%}%{$fg[green]%}"
elif [[ ${git_status} =~ "Changes to be committed" ]]; then
state="%{$terminfo[bold]%}%{$fg[yellow]%}"
@eutobias
eutobias / sha256
Created August 19, 2019 20:29
SHA256
function sha256(message, cb) {
var encoder = new TextEncoder()
var data = encoder.encode(message)
crypto.subtle.digest('SHA-256', data).then(function(hash) {
var hashArray = Array.from(new Uint8Array(hash))
hashArray.forEach(function(b, i) {
hashArray[i] = hashArray[i].toString(16).padStart(2, '0')
})
cb(hashArray.join(''))
}).catch(function(err) {
@eutobias
eutobias / uuid.js
Created August 19, 2019 20:26
Generate UUID
function uuid() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1)
}
return (s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4())
}
// USAGE
var uuid = uuid()
@eutobias
eutobias / index.lua
Last active May 6, 2024 13:42
Hammerspoon config for horizontal scroll on mouse middle button click
-- Bases in some codes i found on internet
-- but i din't find the links again
-- HANDLE SCROLLING
local scrollmultHorizontal = 2
local scrollmultVertical = 2 -- not used if use only horizontal scroll
local middleMouseEventButtonNumber = 2
hs.eventtap.new(
{"all"},
@eutobias
eutobias / .git_colors
Last active June 1, 2021 22:55
Show git branch on terminal with colors, green if updated, yellow Changes added to be committed and red if has changes
##############
# GIT COLORS #
##############
# Based in alot of info that i found in internet, sorry if i did not credit you
# i got a lot of stuff from a alot of places
# just put everything together
# working on MacOs Sierra
# Regular