Skip to content

Instantly share code, notes, and snippets.

@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."