Skip to content

Instantly share code, notes, and snippets.

View haythamdouaihy's full-sized avatar

hd84335 haythamdouaihy

  • Beirut, Lebanon
View GitHub Profile
@haythamdouaihy
haythamdouaihy / git-rename-branch.sh
Last active June 11, 2018 15:05 — forked from lttlrck/gist:9628955
git rename local and remote branch
# 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
Created June 11, 2018 15:01
git rename local and remote branch
# 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 / github-editor-textarea-enlarger.css
Last active April 24, 2018 17:11
Github editor textarea enlarger
/*
. 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 13:02
update git repositories included in a folder after resetting hard into a branch name passed as parameter (example: master)
#!/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 / gist:682d7c808933bc7704d0
Created May 12, 2015 10:16
SQL- rows having duplicate column value
-- query that returns duplicate colum value
select
count(<duplicated_column_name>),
<duplicated_column_name>,
<other>
from
<table_name>
group by
<duplicated_column_name>
HAVING