Skip to content

Instantly share code, notes, and snippets.

View versluis's full-sized avatar

Jay Versluis versluis

View GitHub Profile
#########################
# .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,
@versluis
versluis / ajax.php
Last active December 14, 2015 11:58
This code adds category posting back into P2
// 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 / backBtn.js
Last active December 11, 2015 11:09
How to bring back the "back" button in jquery mobile. Call this before linking the jquery mobile library in your fie.
<script type="text/javascript">
// adding a back button
$(document).bind("mobileinit",function() {$.mobile.page.prototype.options.addBackBtn = true; });
</script>
@versluis
versluis / custom.xml
Created September 27, 2012 17:53
Default MySQL Heatlh Configration
<!-- after -->
<service name="MySql" monitor="true">
<alarm level="red" threshold="50" type="percent"/>
<alarm level="yellow" threshold="40" type="percent"/>
</service>
@versluis
versluis / alertView.m
Created August 1, 2012 17:36
How to react to a UIAlertView
- (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?");
@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];
@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 / 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 / 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 / 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
#