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 /path/to/directory -name "*.ext" -exec bash -c 'mv {} $(echo {} | sed -e "s/foo/bar/")' \; |
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
/// This is free and unencumbered software released into the public domain. | |
/// | |
/// Anyone is free to copy, modify, publish, use, compile, sell, or | |
/// distribute this software, either in source code form or as a compiled | |
/// binary, for any purpose, commercial or non-commercial, and by any | |
/// means. | |
/// | |
/// In jurisdictions that recognize copyright laws, the author or authors | |
/// of this software dedicate any and all copyright interest in the | |
/// software to the public domain. We make this dedication for the benefit |
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/bash | |
usage() | |
{ | |
printf "Supported commands:\n\tadd - adds all new files\n\tremove - removes all deleted files\n\tdiff - colorized diff\n" | |
exit 1 | |
} | |
if [ "$#" -eq "0" ]; then usage; fi | |
if [ $1 == "add" ]; then | |
svn st | grep ^? | sed 's/^\? *//' | xargs -I% svn add %@ |
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
<macrodef name="juicer"> | |
<attribute name="inputFile" /> | |
<!-- none|soft|rails|hard --> | |
<attribute name="cacheBuster" default="none" /> | |
<!-- none|data_uri --> | |
<attribute name="embedImages" default="data_uri" /> | |
<sequential> | |
<exec executable="juicer" failOnError="true" logError="true"> | |
<arg value="-v" /> | |
<arg value="merge" /> |
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
/** | |
* This will convert DateTime (.NET) object serialized as JSON by WCF to a NSDate object. | |
*/ | |
+ (NSDate *)dateFromJSONTicks:(NSString *)inputString; |
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
@class SCViewSlider; | |
@interface MainController : UIViewController { | |
@private | |
SCViewSlider *_viewSlider; | |
} | |
@property (nonatomic, retain) IBOutlet SCViewSlider *viewSlider; | |
@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
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *) | |
peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person | |
property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier { | |
ABMultiValueRef emails = ABRecordCopyValue(person, property); | |
CFStringRef email = ABMultiValueCopyValueAtIndex(emails, identifier); | |
NSString *str = [textField text]; | |
if (![str isEqualToString:@""]) { |
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
/* http://stackoverflow.com/questions/3128752/draw-line-in-uiview */ | |
- (void)drawRect:(CGRect)rect | |
{ | |
[super drawRect:rect]; | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor); | |
// Draw them with a 2.0 stroke width so they are a bit more visible. | |
CGContextSetLineWidth(context, 2.0f); |
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/bash | |
output=~/data.ab | |
package=${1:-"com.my.package"} | |
openssl="/usr/local/opt/openssl/bin/" | |
export PATH=$openssl:$PATH | |
adb -d backup -f $output -noapk $package | |
pushd ~ | |
dd if=$output bs=1 skip=24 | openssl zlib -d | tar -xvf - | |
rm $output |
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
for f in *.m4a; do atomicparsley "$f" --artwork folder.jpg; done; rm !(*temp*); for f in *.m4a; do g=${f//-temp*./.}; mv "$f" "$g"; done; |
NewerOlder