Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
duzun committed Dec 9, 2017
1 parent 8169e06 commit f993c8d
Show file tree
Hide file tree
Showing 12 changed files with 827 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]

# change these settings to your own preference
indent_style = space
indent_size = 4

# we recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.json]
indent_style = space
indent_size = 2

[*.sublime-project]
indent_style = tab
indent_size = 4
62 changes: 62 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Enforce LF line endings
* text eol=lf

# Text file extensions
*.php text eol=lf
*.js text eol=lf
*.json text eol=lf
*.css text eol=lf
*.less text eol=lf
*.inf text eol=lf
*.txt text
*.html text eol=lf
*.htm text eol=lf
*.xml text eol=lf

# Scripts
*.cmd text eol=crlf
*.sh text eol=lf


# Binary file extensions
*.phar binary
*.dat binary
*.exe binary
*.dll binary

## Documents
*.pdf binary
*.doc binary
*.xls binary
*.docx binary
*.xlsx binary

## Imgaes
*.webp binary
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.bmp binary
*.ico binary
*.cur binary
*.psd binary

## Audio/Video/Flash
*.mp3 binary
*.wav binary
*.flv binary
*.swf binary
*.mp4 binary

## Archives
*.rar binary
*.zip binary
*.gz binary
*.7z binary

## Fonts
*.ttf binary
*.eot binary
*.woff binary
*.otf binary
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
error.log
npm-debug.log

~/.extend.*

*.sublime-workspace
12 changes: 12 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

p="$(realpath `dirname $0`)/~"
ln -sf "$p/.profile" ~/
ln -sf "$p/.gitconfig" ~/
ln -sf "$p/.gitignore" ~/
ln -sf "$p/.vimrc" ~/

ls -a "$p" | grep '^\.extend\.' | while read i; do
cat "$p/$i" >> ~/"$i";
done

86 changes: 86 additions & 0 deletions ~/.aliasrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Functions
#alias ..="cd .."

# $ .. [nr]
function ..() {
local i=$1
if [ $# -eq 0 ]
then
i=1
fi
local LASTDIR=$PWD
while [ $i -gt 0 ]
do
cd ..
i=$(($i - 1))
done
export OLDPWD=$LASTDIR
}

# $ up "part_str"
function up {
local up=`expr "$PWD" : "^\(.*$1[^/]*\)"`
[ "x$up" == "x" ] || cd $up
}

function f() {
find $PWD -type f -name $1
}

# This alias recursively destroys all .DS_Store files in the folder I am currently in
alias killDS='find . -name *.DS_Store -type f -delete'

# ls
alias ls="ls --color=tty"
alias l='ls -alh'
alias la="ls -ah"
alias ll="ls -lh"
alias l.="ls -dh .*"


# Git
alias g="git"
alias gva="git status"
alias gv="git status ."
alias gda="git diff"
alias gd="git diff ."
alias ga="git add"
alias gap="git add -p"
alias gaa="git add --all"
alias gc="git commit"
alias gcm="git commit -m"
alias gu="git push"
alias gut="git push --tags"
alias guf="git push -f"
alias gl="git pull"
alias gls="git pull --rebase"
alias gs="git rebase"
alias gss="git rebase --skip"
alias gsc="git rebase --continue"
alias glo="git pull origin"
alias go="git checkout"
alias ge="git merge"
alias gr="git remote"
alias gb="git branch"
alias gt="git tag"
alias gf="git fetch"
alias gg="git log"

function tgcm() {
GIT_AUTHOR_DATE=$1 GIT_COMMITTER_DATE=$1 gcm "$2" --date $1
}

alias psgrep="ps -aux | grep -v grep | grep --color"

# NPM
# alias n="npm"
alias nu="npm update"
alias ni="npm i"
alias ns="npm run"
alias np="npm publish"

# Composer
alias cu="composer update"
alias ci="composer install"
alias cr="composer require"
alias cs="composer run-script"
36 changes: 36 additions & 0 deletions ~/.aliasrc.linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

alias www="cd /var/www/"
alias proj="cd /var/www/projects"

# open like on Max
alias open="xdg-open"

# Disable beep
command -v xset > /dev/null && xset -b
#setterm -blength 0 2>&1

yaourt=`command -v yaourt`
if [ ! -z "$yaourt" ]; then
alias y="yaourt" # search
alias yq="yaourt --noconfirm" # search +silent
alias yu="yaourt -Syu" # update & upgrade
alias yuq="yaourt -Syu --noconfirm" # update & upgrade
alias yua="yaourt -Syua" # update & upgrade + AUR (less safe)
alias yuaq="yaourt -Syua --noconfirm" # update & upgrade + AUR (less safe)
alias yi="yaourt -S" # <pkg_name> # install
alias yiq="yaourt --noconfirm -S" # <pkg_name> # install +silent
alias yr="yaourt -R" # <pkg_name> # uninstall
alias yrf="yaourt -Rsn" # <pkg_name> # uninstall completely: configs and dependencies
alias yl="yaourt -Qm" # list installed packages
fi

systemctl=`command -v systemctl`
if [ ! -z "$systemctl" ]; then
alias ss="systemctl"
alias ssv="systemctl status"
alias sss="systemctl start"
alias sst="systemctl stop"
alias ssl="systemctl reload"
alias ssr="systemctl restart"
alias sse="systemctl enable"
fi
29 changes: 29 additions & 0 deletions ~/.gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[merge]
tool = kdiff3
[diff]
guitool = kdiff3
[core]
editor = subl -w
autocrlf = false
filemode = false
[alias]
unadd = reset HEAD
[color]
ui = true
[credential]
; helper = manager
; helper = wincred
helper = gnome-keyring
modalprompt = true
[push]
default = simple
[user]
name = Dumitru Uzun
email = contact@duzun.me
username = duzun
[filter "lfs"]
clean = git lfs clean %f
smudge = git lfs smudge %f
required = true
[cola]
spellcheck = false
14 changes: 14 additions & 0 deletions ~/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error.log

# Folder view configuration files
.DS_Store?
Desktop.ini

# Thumbnail cache files
._*
Thumbs.db

# Files that might appear on external disks
.Spotlight-V100
.Trashes

116 changes: 116 additions & 0 deletions ~/.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
######################
# DUzun's .profile #
# Windows #
# @version 1.3.0 #
######################


# Set user-defined locale
# export LANG=$(locale -uU)

# This is a DEV machine
[ -z "$ENV" ] && ENV=dev && export ENV

if [ "$(uname)" == "Darwin" ]; then
# Do something under Mac OS X platform
_os=osx
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# Do something under GNU/Linux platform
_os=linux
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
# Do something under Windows NT platform
_os=windows
fi

export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

###############################################################################
# Shell behavior #
###############################################################################

# Check the window size after each command and, if necessary, update the values
# of LINES and COLUMNS.
shopt -s checkwinsize

# Append all commands to the history file; don't overwrite it at the start of every new session
shopt -s histappend

# Increase the history file size and set some sane defaults
export HISTSIZE=20000
export HISTFILESIZE=10000
export HISTCONTROL=ignoreboth
export HISTCONTROL=ignorespace # Don't store commands beginning with a space

function edit() {
if [ -f "$EDITOR" ]; then
command $EDITOR $@;
else
echo "Editor not found (\$EDITOR='$EDITOR')";
return -1;
fi;
}

function overdel() {
p=`raelpath $1`
find "$p" -type f | while read i; do
s=`ls -l $i | awk '{print $5}'`;
echo "$s > $i";
head -c $s < /dev/urandom > "$i";
rm -rf "$i";
done;
}

function npmbin() {
local npmbin=`pwd`/node_modules/.bin;
[ -d "$npmbin" ] && PATH=$npmbin:$PATH && echo $npmbin;
return $?;
}

function composerbin() {
local composerbin=`pwd`/vendor/bin;
[ -d "$composerbin" ] && PATH=$composerbin:$PATH && echo $composerbin;
return $?;
}

# Enable completion for aliases
complete -o default -o nospace -F _git_branch gb
complete -o default -o nospace -F _git_checkout gco

# If running interactively, set PS1
if [[ "$-" == *i* ]]
then
if [ -f ~/.bash-git-prompt/gitprompt.sh ]; then
. ~/.bash-git-prompt/gitprompt.sh
GIT_PROMPT_ONLY_IN_REPO=1
fi

# If the git completion function exists, then use its built-in command prompt
if command -v __git_ps1 > /dev/null; then
export PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h\[\033[36m\]`__git_ps1`\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n> ';
else
export PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n> ';
fi
fi

# Load OS speciffic .profile
# echo .: ${BASH_SOURCE[@]}
if [ -z "$BASH_SOURCE" ]; then local BASH_SOURCE=$_; fi

_profile=`realpath ${BASH_SOURCE[0]}`
_dotfiles=`dirname "$_profile"`

function inalias() {
local p=$1
[ -z "$p" ] && p=$_dotfiles;
if [ -z "$p" ] ; then return 1; fi
[ -f "$p/.aliasrc" ] && . "$p/.aliasrc";
[ ! -z "$_os" ] && [ -f "$p/.aliasrc.$_os" ] && . "$p/.aliasrc.$_os";
[ -f ~/.extend.aliasrc ] && . ~/.extend.aliasrc;
}

if [ ! -z "$_os" ] && [ -f "$_profile.$_os" ] ; then . "$_profile.$_os"; fi
inalias $_dotfiles;

npmbin;
composerbin;
Loading

0 comments on commit f993c8d

Please sign in to comment.