Skip to content

Instantly share code, notes, and snippets.

View gfazioli's full-sized avatar
🏠
Working from home

Giovambattista Fazioli gfazioli

🏠
Working from home
View GitHub Profile
@justintadlock
justintadlock / register-post-type.php
Last active June 3, 2024 13:31
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
CGSize size = [view bounds].size;
UIGraphicsBeginImageContext(size);
[[view layer] renderInContext:UIGraphicsGetCurrentContext()];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
@leviathan
leviathan / Load UIView with nib
Created January 7, 2011 14:53
Loading a custom UIView class with a custom nib file.
QPickOneView* myView = nil;
NSArray* nibViews = [[NSBundle mainBundle] loadNibNamed:@"QPickOneView" owner:self options:nil];
for (id currentObject in nibViews) {
if ([currentObject isKindOfClass:[QPickOneView class]]) {
myView = (QPickOneView *) currentObject;
break;
}
}
@niran
niran / WordPress category object structure.php
Created July 20, 2009 20:33
WordPress category object structure
<?php
# If you haven't played around with WordPress much and you're trying to find out what
# exactly this "category object" thing that's referenced in many places is. You might
# look for a category table in the database for some clues, but there isn't one. That's
# because WordPress uses "terms" to handle both categories and tags, each of which are
# "taxonomies". Looking in those tables will give you want you want, or you could just
# print a category object.
#
# More info: http://codex.wordpress.org/WordPress_Taxonomy