Skip to content

Instantly share code, notes, and snippets.

View emreberge's full-sized avatar

Emre Berge Ergenekon emreberge

View GitHub Profile
@emreberge
emreberge / App permissions.md
Last active October 26, 2020 13:04
Added Spotify to the list
@emreberge
emreberge / KeyPath.h
Last active September 3, 2015 12:15
Compiler help for keyPaths!
#define KeyPath(keyPath)\
^NSString *(void) {\
__unused __typeof__(keyPath) x;\
return [@#keyPath substringFromIndex:([@#keyPath rangeOfString:@"."].location + 1)];\
}()
@emreberge
emreberge / replace-files.sh
Created March 30, 2015 20:05
Replaces all files found in specified directory three with their equal named counterparts from the other speicifed directory.
#!/usr/bin/env bash
set -u
set -e
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]:-$0}" )" && pwd )"
script_name="$( basename "${BASH_SOURCE[0]:-$0}" )"
print_usage_and_exit()
{
echo "Replaces all files found in specified directory three with their equal named counterparts from the other speicifed directory."
@emreberge
emreberge / custom-commands.plist
Last active October 6, 2021 14:18
Custom command on Xcode
<key>Customized</key>
<dict>
<key>Duplicate Current Line Below</key>
<string>selectLine:, copy:, moveRight:, paste:, moveLeft:</string>
<key>Duplicate Current Line Above</key>
<string>selectLine:, copy:, moveToBeginningOfLine:, paste:, moveLeft:</string>
<key>Delete Current Line</key>
<string>selectLine:, deleteBackward:</string>
</dict>
@emreberge
emreberge / scp-path.sh
Created January 17, 2012 21:56
Creates a scp compatiable path for the specified file. "my-username@my-hostname:/path/to/specified/file"
#!/usr/bin/env sh
echo "$(whoami)@$(hostname -f):$(cd "$(dirname $1)" && pwd)/$(basename $1)"
@emreberge
emreberge / Bash-help.sh
Created December 2, 2011 20:25
Bash help function for using with oh-my-zshell
function help(){
bash -c "help $@"
}