This file contains hidden or 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
| iOsScrollingToggle : function(enabled){ | |
| function preventScroll(e){ | |
| e.preventDefault(); | |
| e.stopPropagation(); | |
| } | |
| // This should prevent people from scrolling away from the modal window without closing it | |
| if(enabled){ | |
| document.body.removeEventListener('touchmove',preventScroll,false); | |
| } else { | |
| document.body.addEventListener('touchmove',preventScroll,false); |
This file contains hidden or 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
| NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]]; | |
| NSArray *fontNames; | |
| NSInteger indFamily, indFont; | |
| for (indFamily=0; indFamily<[familyNames count]; ++indFamily) { | |
| NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]); | |
| fontNames = [[NSArray alloc] initWithArray: [UIFont fontNamesForFamilyName: [familyNames objectAtIndex:indFamily]]]; | |
| for (indFont=0; indFont<[fontNames count]; ++indFont) { | |
| NSLog(@"Font name: %@", [fontNames objectAtIndex:indFont]); | |
| } | |
| [fontNames release]; |
This file contains hidden or 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
| <!-- Sample usage: http://localhost/convert/gist.github.com/gists/128733 --> | |
| <!-- Hardcoded charset bug to be sorted out yet --> | |
| <?php $f = file("http://".$_SERVER['QUERY_STRING']); ?> | |
| <?php header("Content-type: text/html; charset=cp1251"); ?> | |
| <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"> | |
| <style> body { width: 320px !important; } nobr {white-space: normal !important; } dd { margin: 5px 10px;} </style> | |
| <?php echo implode($f, "") ?> |
This file contains hidden or 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
| NSString *id = [[UIDevice currentDevice] uniqueIdentifier]; |
This file contains hidden or 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
| #if TARGET_IPHONE_SIMULATOR | |
| NSLog(@"Some debugging"); | |
| #else | |
| // Do nothing! | |
| #end |
This file contains hidden or 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
| (function($) { | |
| var userAgent = navigator.userAgent.toLowerCase(); | |
| $.extend($.browser, { | |
| iphone: $.browser.safari && /iphone/.test(userAgent), | |
| chrome: $.browser.safari && /chrome/.test(userAgent) | |
| }); | |
| })(jQuery); |
This file contains hidden or 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)application:(UIApplication *)application | |
| didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
| if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { | |
| [self.window addSubview:self.splitVC.view]; | |
| } else { | |
| [self.window addSubview:self.navigationController.view]; | |
| } | |
| [self.window makeKeyAndVisible]; | |
| return YES; |
This file contains hidden or 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
| UIApplication sharedApplication].idleTimerDisabled = YES; |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Reflection; | |
| using MonoTouch.Foundation; | |
| using MonoTouch.UIKit; | |
| public class MyDatasource : UITableViewDataSource | |
| { | |
| object[] dataArray; |
This file contains hidden or 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
| -(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { | |
| NSSet *touches = [event allTouches]; | |
| BOOL forwardToSuper = YES; | |
| for (UITouch *touch in touches) { | |
| if ([touch tapCount] >= 2) { | |
| // prevent this | |
| forwardToSuper = NO; | |
| } | |
| } | |
| if (forwardToSuper){ |