Skip to content

Instantly share code, notes, and snippets.

View MP0w's full-sized avatar
🏍️

Alex Manzella MP0w

🏍️
View GitHub Profile
@MP0w
MP0w / gist:11351182
Created April 27, 2014 17:37
2048 is not enough...
// cheat in the game 2048
// cheat is not funny so don't compile to cheat
// so why I did?
// what is funny is to make the cheat, not to play with it =)
// how to get headers of App Store Apps ?
// https://github.com/MP0w/dumpdecrypted
@interface ViewController: NSObject
- (void)cheat;
@MP0w
MP0w / gist:8527677
Created January 20, 2014 19:47
Pluck?
//place a button somewhere and add a target with selector showMusic:
//....
-(void)showMusic:(UIButton *)aButtonPlacedSomewhere{
MPMediaPickerController* picker=[[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic];
picker.showsCloudItems=YES;
picker.allowsPickingMultipleItems=YES;
picker.delegate=self;
[self presentViewController:picker animated:NO completion:NULL];
}
@MP0w
MP0w / gist:8216753
Created January 2, 2014 09:19
Fix iOS 7 texview that doesn't scroll properly while you type
- (void)textViewDidChange:(UITextView *)textView {
CGRect line = [textView caretRectForPosition:
textView.selectedTextRange.start];
CGFloat overflow = line.origin.y + line.size.height
- ( textView.contentOffset.y + textView.bounds.size.height
- textView.contentInset.bottom - textView.contentInset.top );
if ( overflow > 0 ) {
CGPoint offset = textView.contentOffset;
offset.y += overflow + 7;
[UIView animateWithDuration:.2 animations:^{