Skip to content

Instantly share code, notes, and snippets.

View versluis's full-sized avatar

Jay Versluis versluis

View GitHub Profile
@versluis
versluis / blog.php
Created June 14, 2012 08:35
How to eliminate blog text on the front page of Modularity Lite
<?php
/**
* @package WordPress
* @subpackage Modularity
*/
?>
<div class="span-<?php modularity_sidebar_class(); ?>">
<?php get_sidebar(); ?>
</div>
@versluis
versluis / gist:2950371
Created June 18, 2012 19:56
How to test the state of a UISwitch
if (flickSwitch.isOn ) {
statusLabel.text = @"The Switch is ON";
} else {
statusLabel.text = @"The Switch is OFF";
}
@versluis
versluis / gist:2994892
Created June 26, 2012 10:28
Caption in WordPress 3.4
[caption id="attachment_123" align="aligncenter" width="550"]
<img src="...">My Caption[/caption]
@versluis
versluis / gist:2994898
Created June 26, 2012 10:30
Caption in WordPress 3.3.2
[caption id="attachment_123" align="aligncenter" width="550" caption="My Caption"]
<img src="...">[/caption]
@versluis
versluis / ajax.php
Created June 29, 2012 07:49
How to bring back Post Categories in P2 v1.4
// 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',
@versluis
versluis / subversion.conf
Created July 17, 2012 15:06
How to install Subversion on CentOS with Plesk
#
# Example configuration to enable HTTP access for a directory
# containing Subversion repositories, "/var/www/svn". Each repository
# must be both:
#
# a) readable and writable by the 'apache' user, and
#
# b) labelled with the 'httpd_sys_content_t' context if using
# SELinux
#
@versluis
versluis / webview
Created July 24, 2012 06:43
How to load a URL into a web view
NSURL *detailURL;
detailURL=[[NSURL alloc] initWithString:@"http://www.yourwebsite.com"];
[self.myWebView loadRequest:[NSURLRequest requestWithURL:detailURL]];
@versluis
versluis / ViewController.h
Created July 24, 2012 07:38
Spinning Wheel Acitivity Indicator
#import <UIKit/UIKit.h>
@interface WebViewController : UIViewController <UIWebViewDelegate>
@property (strong, nonatomic) IBOutlet UIWebView *myWebView;
@property (strong, nonatomic) IBOutlet UIActivityIndicatorView *spinningWheel;
- (IBAction)dismissModalView:(id)sender;
- (IBAction)stopSpinning:(id)sender;
@versluis
versluis / functions.php
Created July 26, 2012 15:22
How to change the Nav Menu Title in AutoFocus 1.0.1
echo '<div id="menu"><ul><li><a href="'. get_settings('home') .'/" title="'. get_bloginfo('name') .'" rel="home" rel="nofollow">Home</a></li>';
@versluis
versluis / buttons.m
Created July 27, 2012 14:42
How to create a custom button
UIImage *normal = [UIImage imageNamed:@"normalButton.png"];
UIImage *highlighted = [UIImage imageNamed:@"pressedButton.png"];
[self.theButton setBackgroundImage:normal forState:UIControlStateNormal];
[self.theButton setBackgroundImage:highlighted forState:UIControlStateHighlighted];