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 | |
DATE=`date +"%Y-%m-%d-%H-%M-%S"` | |
FILENAME="s-${DATE}.png" | |
echo "capturing ${FILENAME}..." | |
adb shell screencap -p "/sdcard/${FILENAME}" | |
adb pull /sdcard/"${FILENAME}" | |
adb shell rm "/sdcard/${FILENAME}" | |
echo "saved ${FILENAME}." |
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
@implementation UILabel (Extensions) | |
... | |
- (void)setLineHeight:(float)lineHeight | |
{ | |
NSMutableParagraphStyle *paragrahStyle = [[NSMutableParagraphStyle alloc] init]; | |
paragrahStyle.minimumLineHeight = lineHeight; | |
paragrahStyle.maximumLineHeight = lineHeight; | |
NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] |
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 . -exec grep -nHE "foo" {} \; |
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
bundle exec thin start -R config.ru --threaded -p 9292 |
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
bundle exec puma -p 9292 -e development -t 0:20 -C config/puma.rb |
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
`ps alx | grep \[r\]uby | awk '{printf ("%d", $8)}'`.to_i | |
`ps -o rss= -p #{Process.pid}`.to_i |
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
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event | |
{ | |
UITouch *touch = [touches anyObject]; | |
CGPoint p = [touch locationInView:aView]; | |
NSLog(@"Touch detected: x=%lf, y=%lf", p.x, p.y); | |
if (0 <= p.y && p.y <= aView.frame.size.height | |
&& 0 <= p.x && p.x <= aView.frame.size.width) | |
{ | |
//do something | |
} |
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
+ (void)showViewControllerAndNavigationControllerFromParentViewController:(UIViewController *)parentVC | |
{ | |
AViewController *vc = [[[AViewController alloc] init] autorelease]; | |
UINavigationController* nc = [[[UINavigationController alloc] | |
initWithRootViewController:vc] autorelease]; | |
nc.modalTransitionStyle = UIModalTransitionStyleCoverVertical; | |
vc.navigationController = nc; | |
vc.navigationBar = nc.navigationBar; |
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
// | |
// AViewController.h | |
// | |
@protocol AViewControllerDelegate; | |
@interface AViewController : UIViewController <AViewControllerDelegate> | |
{ | |
id <AViewControllerDelegate> delegate; | |
} | |
@property (nonatomic, retain) id <AViewControllerDelegate> delegate; |
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
#-------- | |
# xcode noise | |
build/* | |
*.xcodeproj/* | |
!*.xcodeproj/project.pbxproj | |
!*.xcodeproj/default.* | |
**/*.xcodeproj/* | |
!**/*.xcodeproj/project.pbxproj |
NewerOlder