This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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]%}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############## | |
# 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 |