Skip to content

Instantly share code, notes, and snippets.

Avatar

hd84335 haythamdouaihy

  • Beirut, Lebanon
View GitHub Profile
@haythamdouaihy
haythamdouaihy / gist:682d7c808933bc7704d0
Created May 12, 2015
SQL- rows having duplicate column value
View gist:682d7c808933bc7704d0
-- query that returns duplicate colum value
select
count(<duplicated_column_name>),
<duplicated_column_name>,
<other>
from
<table_name>
group by
<duplicated_column_name>
HAVING
@haythamdouaihy
haythamdouaihy / github-editor-textarea-enlarger.css
Last active Apr 24, 2018
Github editor textarea enlarger
View github-editor-textarea-enlarger.css
/*
. solution already provided by CodeMirror (https://codemirror.net/demo/resize.html#).
. to implement it, we must create an browser app in order to load it each time a gist editor will be opened
. in case of chrome, app already created, you can use it and follow manual for more details
(https://github.com/haythamdouaihy/github-editor-textarea-enlarger-chrome-ext)
*/
.CodeMirror {
border: 1px solid #eee;
height: auto;
@haythamdouaihy
haythamdouaihy / update-git-repos-reset-hard.sh
Last active May 4, 2018
update git repositories included in a folder after resetting hard into a branch name passed as parameter (example: master)
View update-git-repos-reset-hard.sh
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# retrieve base repo parameter
# 1st param: alias of the remote repo URL (example: origin)
# 2nd param: remote branch name (example: master)
BASE_REPO="$1"/"$2"
@haythamdouaihy
haythamdouaihy / git-rename-branch.sh
Created Jun 11, 2018
git rename local and remote branch
View git-rename-branch.sh
# 1. rename local branch
git branch -m new_branch
# 2. delete old branch from remote
git push origin :old_branch
# 3. push & create new branch to upstream
git push --set-upstream origin new_branch
@haythamdouaihy
haythamdouaihy / git-rename-branch.sh
Last active Jun 11, 2018 — forked from lttlrck/gist:9628955
git rename local and remote branch
View git-rename-branch.sh
# 1. rename local branch
git branch -m new_branch
# 2. delete old branch from remote
git push origin :old_branch
# 3. push & create new branch to upstream
git push --set-upstream origin new_branch