This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch | grep "some_string_or_pattern" | xargs -n 1 git branch-delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import fileinput | |
import json | |
if __name__ == "__main__": | |
text = '' | |
for line in fileinput.input(): | |
text = text + ' ' + line.strip() | |
jsonObj = json.loads(text) | |
print json.dumps(jsonObj, sort_keys=False, separators=(',',':')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name '.svn' | xargs git rm -rf --ignore-unmatch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name *3x.png | xargs sips -Z 168 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Reference: | |
# http://www.mactricksandtips.com/2012/02/installing-and-using-pngcrush-on-your-mac.html | |
for png in `find $1 -name "*.png"`; | |
do | |
echo "crushing $png" | |
pngcrush -rem allb -brute -reduce "$png" temp.png | |
mv -f temp.png $png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 80000 | |
@interface NSString (PSPDFModernizer) | |
// Added in iOS 8, retrofitted for iOS 7 | |
- (BOOL)containsString:(NSString *)aString; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* File: check64bit.c | |
* Description: Check if the running version of Mac OS X is 64-bit | |
* To Compile: gcc -Wall -o check64bit check64bit.c | |
* To run: ./check64bit | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/utsname.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls foo*.jpg | awk '{print("mv "$1" "$1)}' | sed 's/foo/bar/2' | /bin/sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import fileinput | |
import json | |
if __name__ == "__main__": | |
text = '' | |
for line in fileinput.input(): | |
text = text + ' ' + line.strip() | |
jsonObj = json.loads(text) | |
print json.dumps(jsonObj, sort_keys=False, indent=2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
VER1=2.6.33.2 | |
VER2=2.6.38 | |
OSVERSION=`sw_vers -productVersion` | |
echo "Current OS Version: $OSVERSION" | |
echo "Arg 2 : $# $0 $1 $2" | |
if [[ $VER1 > $VER2 ]]; then |
OlderNewer