Skip to content

Instantly share code, notes, and snippets.

@dislick
dislick / .bash_profile
Last active December 7, 2016 12:46
My bash_profile
# enable colors in your terminal
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
# aliases
alias ls='ls -GFh'
alias gitc='git add --all && git commit -m'
alias gitl='git log --graph --oneline --decorate'
alias gitd='git status && git status | grep ": " | sed -e 's/[a-z]*://' | git diff'
@dislick
dislick / semanticVersioningConversion.js
Last active March 6, 2023 00:42
Convert Semantic Versioning String to Integer in ES6
/**
* Convert a sematic versioning string into an 32-bit integer.
*
* Make sure the input string is compatible with the standard found
* at semver.org. Since this only uses 10-bit per major/minor/patch version,
* the highest possible SemVer string would be 1023.1023.1023.
* @param {string} version SemVer string
* @return {number} Numeric version
*/
const convertVersionToInt32 = function(version) {