Skip to content

Instantly share code, notes, and snippets.

@dearaujoj
dearaujoj / remove_git_tag
Created October 22, 2013 10:02
git remove tag locally and remote
git tag -d TagName && git push origin :refs/tags/TagName
@dearaujoj
dearaujoj / diff_branch.sh
Created October 30, 2013 18:14
Find differences between two branches
MASTER=`git log --pretty=format:'%H' develop | sort`
DEV=`git log --pretty=format:'%H' new_develop | sort`
for i in `diff <(echo "${MASTER}") <(echo "${DEV}") | grep '^>' | sed 's/^> //'`;
do
git --no-pager log -1 --oneline $i;
done
@dearaujoj
dearaujoj / MemoryAll
Created October 17, 2013 08:41
Total amount of memory used by the various process running on Linux
ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | awk '{total=total + $1} END {print total}'
@dearaujoj
dearaujoj / gist:5661536
Created May 28, 2013 09:12
Push a local branch to a different remote branch
git push remote local_branch:remote_branch
#Remove files from quarantine recursively
xattr -d -r com.apple.quarantine ./Folder
@dearaujoj
dearaujoj / git-clean.txt
Created December 3, 2012 11:14
git clean command
remove files git clean -f
remove directories, run git clean -f -d.
remove ignored files, run git clean -f -X.
remove ignored as well as non-ignored files, run git clean -f -x.
Note the case difference on the X for the two latter commands.
Unless you specify -f and clean.requireForce is set to "true" (the default) in your configuration, nothing will actually happen, with a recent enough version of git.
@dearaujoj
dearaujoj / Phantom_UA.sql
Created July 24, 2012 15:02
Universal importer sample
DECLARE
v_GroupName varchar2(200);
BEGIN
v_GroupName := 'Phantom0B';
Delete From uax_import_instances
Where GroupName = v_GroupName;
Delete From uax_import_properties
Where GroupName = v_GroupName;
@dearaujoj
dearaujoj / gist:2663082
Created May 11, 2012 23:29 — forked from anonymous/gist:2388015
iOS fix for iframe cropping
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
if (/iPhone|iPod|iPad/.test(navigator.userAgent))
$('iframe').wrap(function(){
var $this = $(this);
return $('<div />').css({
width: $this.attr('width'),
height: $this.attr('height'),
overflow: 'auto',
sshfs username@hostname:/remote/directory/path /local/mount/point -ovolname=NAME
@dearaujoj
dearaujoj / delete-local-and-remote-tags
Created November 17, 2014 13:33
delete local and remote Git tags programatically
#check tag with specific value
for i in 2013 ; do git tag -l | grep "$i" ; git ls-remote --tags origin | awk '{print ":"$2}' | grep "$i" | grep -v '{}' ; done
#delete local and remote tag with specific value
for i in 2013 ; do git tag -l | grep "$i" | xargs git tag -d ; git ls-remote --tags origin | awk '{print ":"$2}' | grep "$i" | grep -v '{}' | xargs git push origin ; done
#credits http://anavarre.net/2014/01/07/delete-local-and-remote-git-tags-programatically