Skip to content

Instantly share code, notes, and snippets.

@coolgo
coolgo / p4merge
Created October 16, 2015 05:39 — forked from henrik242/p4merge
Helper script for p4merge and Git on MacOSX
#!/bin/bash
for arg; do [[ $arg = /* ]] || arg=$PWD/$arg; absargs+=("$arg"); done;
/Applications/p4merge.app/Contents/Resources/launchp4merge "${absargs[@]}"
#! /bin/sh
lsof -n -i4TCP:$1 | grep LISTEN
pid=`lsof -n -i4TCP:$1 | grep LISTEN | awk '{print $2}'`
if [ $pid ]
then
kill -9 $pid
echo "[`date "+%Y-%m-%d %H:%M:%S"`] Process kill successfull!"
else
echo "[`date "+%Y-%m-%d %H:%M:%S"`] No process exists on port $1."
cdd () {
repo_folder="/Work/Development"
test=`find $repo_folder/* -maxdepth 0 -type d | grep -i "$1" -m 1`
if [ ! $1 ] || [ ! $test ]; then
cd $repo_folder
else
cd $test
fi
}
@interface UIImage (fixOrientation)
- (UIImage *)fixOrientation;
@end