Skip to content

Instantly share code, notes, and snippets.

View paulhuisman's full-sized avatar

Paul Huisman paulhuisman

View GitHub Profile
@paulhuisman
paulhuisman / flickr_field_example.php
Last active August 29, 2015 14:20
Flickr field code example
<?php $flickr_photostream = get_field('flickr_photoset'); ?>
<?php if (isset($flickr_photostream['items'])): ?>
<ul class="flickr-items">
<?php foreach ($flickr_photostream['items'] as $id => $photo): ?>
<li>
<a href="<?php echo $photo['large']; ?>" title="<?php echo $photo['title']; ?>">
<img src="<?php echo $photo['thumb']; ?>" />
</a>
</li>
@paulhuisman
paulhuisman / simpleform_mails
Last active August 29, 2015 14:16
Simpleform Mailform Rails
# model; quotations.rb
class Quotation < MailForm::Base
attribute :name, :validate => true
attribute :email, :validate => /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i
attribute :organisation, :validate => true
attribute :telephone, :validate => true
attribute :attachment, :attachment => true
attribute :message
# Declare the e-mail headers. It accepts anything the mail method
@paulhuisman
paulhuisman / register_post_type.php
Created December 16, 2014 09:42
Register post type in WordPress
<?php
/* Register custom post types on the 'init' hook. */
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 0.1.0
* @access public
@paulhuisman
paulhuisman / git commands
Last active August 29, 2015 13:57
Fancy git commands
// Cherry pick; edit message
git cherry-pick --edit 3fbd473
// Cherry pick; see where its cherry picked from
git cherry-pick -x bdf9578
// Cherry pick; put your username on the cherry pick
git cherry-pick --signoff bdf9578