Skip to content

Instantly share code, notes, and snippets.

@nitriques
Last active June 1, 2019 19:01

Revisions

  1. nitriques revised this gist Sep 20, 2017. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions .bash_profile-bash
    Original file line number Diff line number Diff line change
    @@ -5,12 +5,13 @@ alias grp='grep -B 2 -A 2 -n --color'
    alias l='ls --color=auto -F'
    alias ls='ls --color=auto'

    alias la='l -G'
    alias ll='ls -alF'
    alias la='l -Gh'
    alias ll='ls -alFh'

    alias reload='source ~/.bash_profile'

    alias ..='cd ..'
    alias ...='..;..'
    alias cd..='cd ..'
    alias home='cd ~'
    alias ~='cd ~'
  2. nitriques revised this gist Aug 10, 2017. 2 changed files with 8 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions .bash_profile-bash
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    tabs 4

    alias grp='grep -B 2 -A 2 -n --color'

    alias l='ls --color=auto -F'
    alias ls='ls --color=auto'

    6 changes: 6 additions & 0 deletions .bash_profile-git
    Original file line number Diff line number Diff line change
    @@ -62,5 +62,11 @@ function greco {
    echo "Checked out" $1
    }

    # push to both origin and upstream
    function gpa {
    g push upstream $@;
    g push origin $@;
    }


    alias gim='~/git-imerge/git-imerge'
  3. nitriques revised this gist Jun 29, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions .bash_profile-git
    Original file line number Diff line number Diff line change
    @@ -59,6 +59,7 @@ function grel {
    function greco {
    g reset -- $1;
    gco $1;
    echo "Checked out" $1
    }


  4. nitriques revised this gist Jun 29, 2017. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions .bash_profile-git
    Original file line number Diff line number Diff line change
    @@ -55,6 +55,11 @@ function grel {
    gcm "Release ${v}" -S
    gt $1 -s
    }
    # removes a file from the staging area and check it out
    function greco {
    g reset -- $1;
    gco $1;
    }


    alias gim='~/git-imerge/git-imerge'
  5. nitriques revised this gist Jun 13, 2017. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions .bash_profile-git
    Original file line number Diff line number Diff line change
    @@ -49,5 +49,12 @@ function gcor {
    function gpt {
    git push $1 --tags
    }
    # create release signed commit and signed anotated tag
    function grel {
    v=$1
    gcm "Release ${v}" -S
    gt $1 -s
    }


    alias gim='~/git-imerge/git-imerge'
  6. nitriques revised this gist Jun 13, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions .bash_profile-osx
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    export CLICOLOR=1
    export EDITOR=ex
    export VISUAL=vim

    alias o='open -a Finder .'
    alias s='open -a "Sublime Text" .'
  7. nitriques revised this gist Jun 6, 2017. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion .bash_aliases-ubuntu
    Original file line number Diff line number Diff line change
    @@ -18,5 +18,7 @@ alias nst='netstat -lntp'
    alias kernels='dpkg --list | grep linux-image-3'

    # ubuntu update
    alias update='sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get upgrade -y linux-generic linux-headers-generic linux-image-generic'
    export DEBIAN_FRONTEND=noninteractive
    alias update='sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get upgrade -y linux-generic linux-headers-generic linux-image-generic && nvm install 7 && nvm install 6 && nvm install 8'
    alias install='sudo dpkg -i'

  8. nitriques revised this gist May 18, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .bash_profile-git
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ alias gco='git checkout'
    alias gwack='git reset --hard HEAD~1'
    alias gd='g --no-pager diff'
    alias gds='gd --staged'
    alias gdw='gd --ignore-space-change'
    alias gdw='gd --ignore-space-change --ignore-space-at-eol'
    alias gdp='git diff'
    alias gb='git branch'
    alias g='git'
  9. nitriques revised this gist May 16, 2017. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions .bash_profile-bash
    Original file line number Diff line number Diff line change
    @@ -53,3 +53,6 @@ function ext {
    $4 mv "$f" "${f%.$1}.$2"
    done
    }

    # php lint dirty files
    alias ldp="gs | grep ' M' | awk '/ M (.+)/ { system(\"php -l \" \$2); }'"
  10. nitriques revised this gist Apr 11, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .bash_profile-git
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,7 @@ function gsf {
    }
    # show commit content
    function gsc {
    gd $1 $1^1 "${@:2}"
    gd $1^1 $1 "${@:2}"
    }
    function gt {
    v=$1
  11. nitriques revised this gist Apr 4, 2017. 1 changed file with 15 additions and 1 deletion.
    16 changes: 15 additions & 1 deletion .bash_profile-bash
    Original file line number Diff line number Diff line change
    @@ -38,4 +38,18 @@ function 64e {
    }

    # php lint all
    alias phplint='for D in **/*.php; do php -l $D; done;'
    alias phplint='for D in **/*.php; do php -l $D; done;'

    # extension change
    function ext {
    if [ -z "$1" ]; then
    echo "Missing 1st paramter (old ext)"
    return 1
    elif [ -z "$2" ]; then
    echo "Missing 2nd paramter (new ext)"
    return 2
    fi
    find . $3 -name "*.$1" |while read f; do
    $4 mv "$f" "${f%.$1}.$2"
    done
    }
  12. nitriques revised this gist Mar 21, 2017. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion .bash_profile-git
    Original file line number Diff line number Diff line change
    @@ -45,6 +45,9 @@ function gt {
    function gcor {
    gco -b $2 $1/$2
    }

    # gpt upstream
    function gpt {
    git push $1 --tags
    }

    alias gim='~/git-imerge/git-imerge'
  13. nitriques revised this gist Jan 9, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .bash_profile-bash
    Original file line number Diff line number Diff line change
    @@ -38,4 +38,4 @@ function 64e {
    }

    # php lint all
    for D in **/*.php; do php -l $D; done;
    alias phplint='for D in **/*.php; do php -l $D; done;'
  14. nitriques revised this gist Jan 8, 2017. 1 changed file with 0 additions and 27 deletions.
    27 changes: 0 additions & 27 deletions .bash_profile-git
    Original file line number Diff line number Diff line change
    @@ -41,33 +41,6 @@ function gt {
    git tag -a $1 -m "Version ${v}" $2 $3
    echo "Version ${v} created"
    }
    alias gpo='gp origin'
    alias gf='g fetch'
    alias gfo='gf origin'
    alias gdev='gpo dev'
    alias gl="git log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
    function gcat {
    git cat-file -t $1 && git cat-file -p $@
    }
    # git checkout pull request
    # gcopr upstream 22
    function gcopr {
    git fetch $1 pull/$2/head:pr-$2
    git checkout pr-$2
    }
    # show files in a commit
    function gsf {
    git diff-tree --no-commit-id --name-only -r $@
    }
    # show commit content
    function gsc {
    gd $1 $1^1 "${@:2}"
    }
    function gt {
    v=$1
    git tag -a $1 -m "Version ${v}" $2 $3
    echo "Version ${v} created"
    }
    # checkout remote gcor origin branch
    function gcor {
    gco -b $2 $1/$2
  15. nitriques revised this gist Jan 8, 2017. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion .bash_profile-bash
    Original file line number Diff line number Diff line change
    @@ -35,4 +35,7 @@ function 64d {
    }
    function 64e {
    node -e "console.log(new Buffer(process.argv[1]).toString('base64'))" $@
    }
    }

    # php lint all
    for D in **/*.php; do php -l $D; done;
  16. nitriques revised this gist Jan 8, 2017. 1 changed file with 32 additions and 0 deletions.
    32 changes: 32 additions & 0 deletions .bash_profile-git
    Original file line number Diff line number Diff line change
    @@ -41,5 +41,37 @@ function gt {
    git tag -a $1 -m "Version ${v}" $2 $3
    echo "Version ${v} created"
    }
    alias gpo='gp origin'
    alias gf='g fetch'
    alias gfo='gf origin'
    alias gdev='gpo dev'
    alias gl="git log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
    function gcat {
    git cat-file -t $1 && git cat-file -p $@
    }
    # git checkout pull request
    # gcopr upstream 22
    function gcopr {
    git fetch $1 pull/$2/head:pr-$2
    git checkout pr-$2
    }
    # show files in a commit
    function gsf {
    git diff-tree --no-commit-id --name-only -r $@
    }
    # show commit content
    function gsc {
    gd $1 $1^1 "${@:2}"
    }
    function gt {
    v=$1
    git tag -a $1 -m "Version ${v}" $2 $3
    echo "Version ${v} created"
    }
    # checkout remote gcor origin branch
    function gcor {
    gco -b $2 $1/$2
    }


    alias gim='~/git-imerge/git-imerge'
  17. nitriques revised this gist Dec 20, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .bash_aliases-ubuntu
    Original file line number Diff line number Diff line change
    @@ -18,5 +18,5 @@ alias nst='netstat -lntp'
    alias kernels='dpkg --list | grep linux-image-3'

    # ubuntu update
    alias update='sudo apt-get update && sudo apt-get upgrade && sudo apt-get upgrade linux-generic linux-headers-generic linux-image-generic'
    alias update='sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get upgrade -y linux-generic linux-headers-generic linux-image-generic'
    alias install='sudo dpkg -i'
  18. nitriques revised this gist Dec 2, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions .bash_aliases-ubuntu
    Original file line number Diff line number Diff line change
    @@ -19,3 +19,4 @@ alias kernels='dpkg --list | grep linux-image-3'

    # ubuntu update
    alias update='sudo apt-get update && sudo apt-get upgrade && sudo apt-get upgrade linux-generic linux-headers-generic linux-image-generic'
    alias install='sudo dpkg -i'
  19. nitriques revised this gist Nov 22, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions .bash_profile-windows
    Original file line number Diff line number Diff line change
    @@ -8,3 +8,5 @@ alias s='subl .'
    alias ab='start "" //B //WAIT "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin\ab.exe" '

    export SVN_EDITOR='"C:\Program Files\Git\usr\bin\vim.exe"'

    alias ncu='winpty ncu.cmd'
  20. nitriques revised this gist Nov 22, 2016. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions .bash_aliases-ubuntu
    Original file line number Diff line number Diff line change
    @@ -16,3 +16,6 @@ alias disku='du -s -h'
    alias nst='netstat -lntp'

    alias kernels='dpkg --list | grep linux-image-3'

    # ubuntu update
    alias update='sudo apt-get update && sudo apt-get upgrade && sudo apt-get upgrade linux-generic linux-headers-generic linux-image-generic'
  21. nitriques revised this gist Nov 3, 2016. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions .bash_profile-bash
    Original file line number Diff line number Diff line change
    @@ -28,3 +28,11 @@ function topp {

    # http header
    alias hh='curl -Is'

    # base 64
    function 64d {
    node -e "console.log(new Buffer(process.argv[1], 'base64').toString())" $@
    }
    function 64e {
    node -e "console.log(new Buffer(process.argv[1]).toString('base64'))" $@
    }
  22. nitriques revised this gist Oct 20, 2016. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions .bash_profile-git
    Original file line number Diff line number Diff line change
    @@ -36,5 +36,10 @@ function gsf {
    function gsc {
    gd $1 $1^1 "${@:2}"
    }
    function gt {
    v=$1
    git tag -a $1 -m "Version ${v}" $2 $3
    echo "Version ${v} created"
    }

    alias gim='~/git-imerge/git-imerge'
  23. nitriques revised this gist Oct 17, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions .bash_profile-bash
    Original file line number Diff line number Diff line change
    @@ -12,6 +12,7 @@ alias ..='cd ..'
    alias cd..='cd ..'
    alias home='cd ~'
    alias ~='cd ~'
    alias cd-='cd -'

    function t {
    z $@ trunk
  24. nitriques revised this gist Sep 30, 2016. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion .bash_profile-bash
    Original file line number Diff line number Diff line change
    @@ -23,4 +23,7 @@ function topp {
    pattern=$1
    shift 1
    top -p $(pgrep -d',' $pattern) $@
    }
    }

    # http header
    alias hh='curl -Is'
  25. nitriques revised this gist Sep 13, 2016. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions .bash_profile-svn
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,9 @@ alias svn-ignore="svn propedit svn:ignore"
    function sd {
    svn diff $@ | colordiff
    }
    function sdw {
    sd -x -w $@
    }
    function svnlol {
    svn log $@ | perl -l40pe 's/^-+/\n/'
    }
  26. nitriques revised this gist Aug 30, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions .bash_profile-bash
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    tabs 4

    alias l='ls --color=auto -F'
    alias ls='ls --color=auto'

  27. nitriques revised this gist Aug 19, 2016. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions .bash_profile-workspace
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    alias w='cd workspace/assets/'
    alias b='.. && ..'
    alias v='cat package.json | grep version'
    alias build='w;grunt;v;b'
    alias v='cat package.json | jq .version'
    alias bn='cat build.json | jq .lastBuild'
    alias build='w;grunt;v;bn;b'
    alias buildpush='sup;w;grunt build push --force;v;bn;b'
  28. nitriques revised this gist Jul 4, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .bash_profile-bash
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    alias l='ls --color=auto -F'
    alias ls='ls --color=auto'

    alias la='ls -la'
    alias la='l -G'
    alias ll='ls -alF'

    alias reload='source ~/.bash_profile'
  29. nitriques revised this gist Jun 20, 2016. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions .bash_profile-git
    Original file line number Diff line number Diff line change
    @@ -32,4 +32,9 @@ function gcopr {
    function gsf {
    git diff-tree --no-commit-id --name-only -r $@
    }
    # show commit content
    function gsc {
    gd $1 $1^1 "${@:2}"
    }

    alias gim='~/git-imerge/git-imerge'
  30. nitriques revised this gist May 24, 2016. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions .bash_profile-bash
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,10 @@ alias cd..='cd ..'
    alias home='cd ~'
    alias ~='cd ~'

    function t {
    z $@ trunk
    }

    # this function calls top with a command filter (1st arg)
    # other parameters are passed down to top
    function topp {