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
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { | |
[self.spinningWheel stopAnimating]; | |
UIApplication *application = [UIApplication sharedApplication]; | |
application.networkActivityIndicatorVisible = NO; | |
UIAlertView *infoMessage; | |
infoMessage = [[UIAlertView alloc] | |
initWithTitle:@"The internet is broken" message:@"Looks like there's a problem with your internet connection. Please check and try again later." | |
delegate:self cancelButtonTitle:@"Bloody technology!" otherButtonTitles:nil]; |
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
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { | |
[self myMethod]; | |
if (buttonIndex ==0) { | |
NSLog(@"User pressed first button"); | |
} else if (buttonIndex == 1) { | |
NSLog(@"User pressed second button"); | |
} else { | |
NSLog(@"There were even more buttons?"); |
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
<!-- after --> | |
<service name="MySql" monitor="true"> | |
<alarm level="red" threshold="50" type="percent"/> | |
<alarm level="yellow" threshold="40" type="percent"/> | |
</service> |
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
<script type="text/javascript"> | |
// adding a back button | |
$(document).bind("mobileinit",function() {$.mobile.page.prototype.options.addBackBtn = true; }); | |
</script> |
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
// define $post_cat | |
$post_cat = $_POST['post_format']; | |
// and turn it into the category ID | |
$post_cat = get_category_by_slug( $post_cat ); | |
$post_id = wp_insert_post( array( | |
'post_author' => $user_id, | |
'post_title' => $post_title, | |
'post_content' => $post_content, | |
'post_type' => 'post', |
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
######################### | |
# .gitignore file for Xcode4 / OS X Source projects | |
# | |
# Version 2.0 | |
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
# | |
# 2013 updates: | |
# - fixed the broken "save personal Schemes" | |
# | |
# NB: if you are storing "built" products, this WILL NOT WORK, |
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
//Remove unwanted widgets from Dashboard | |
function remove_dashboard_widgets() { | |
global$wp_meta_boxes; | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); | |
} | |
add_action('wp_dashboard_setup', 'remove_dashboard_widgets'); |
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
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
// your code here, for example | |
$("yourid").fadeIn(2000); | |
}); | |
</script> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>jQuery Mobile Web App</title> | |
<!-- link jQuery Mobile styles --> | |
<link href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" rel="stylesheet" type="text/css"/> | |
<!-- load 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<!-- tells the device browser not make phone numbers clickable --> | |
<meta name="format-detection" content="telephone-no"> | |
<!-- several things are going on here: | |
- first we'll make sure the user can't pinch or zoom |