Skip to content

Instantly share code, notes, and snippets.

View joshuaiz's full-sized avatar
💭
it iz what it iz

Joshua Michaels joshuaiz

💭
it iz what it iz
View GitHub Profile
@joshuaiz
joshuaiz / prepopulate-gf-radio.php
Created May 19, 2017 14:29
Pre-populate Gravity Forms Dropdown
<?php
add_filter( 'gform_pre_render_2', 'populate_posts' );
add_filter( 'gform_pre_validation_2', 'populate_posts' );
add_filter( 'gform_pre_submission_filter_2', 'populate_posts' );
add_filter( 'gform_admin_pre_render_2', 'populate_posts' );
function populate_posts( $form ) {
foreach ( $form['fields'] as &$field ) {
if ( strpos( $field->cssClass, 'populate-posts' ) === false ) {
@joshuaiz
joshuaiz / cpfolder.sh
Last active August 29, 2015 14:15
Copy files and folders from source into current directory
# After struggling with Automator and AppleScript to try to copy a target folder and its contents
# to the current directory, I ended up creating this simple shell script to do just that.
# Every time I get a new web development project I was creating the same folders and subfolders and
# this script does it all in one go. Just create a template (source) folder with everything you need
# in it and then navigate to your target directory in Terminal and run this script by typing cpfolder
# at the command line.
# To install, add this to your ~/.bash_profile and edit [your source] to your preferred source directory
# (remove the brackets). Do not enclose the source directory in quotes. The "." refers to the current directory.
@joshuaiz
joshuaiz / shows-list.php
Created February 18, 2014 01:09
GigPress shows-list.php with gig title(s) added
<?php
// STOP! DO NOT MODIFY THIS FILE!
// If you wish to customize the output, you can safely do so by COPYING this file
// into a new folder called 'gigpress-templates' in your 'wp-content' directory
// and then making your changes there. When in place, that file will load in place of this one.
// This template displays all of our individual show data in the main shows listing (upcoming and past).
// It's marked-up in hCalendar format, so fuck-around with caution.
// See http://microformats.org/wiki/hcalendar for specs
@joshuaiz
joshuaiz / shows-list-start.php
Created February 18, 2014 01:07
GigPress shows-list-start.php with gig title
<?php
// STOP! DO NOT MODIFY THIS FILE!
// If you wish to customize the output, you can safely do so by COPYING this file
// into a new folder called 'gigpress-templates' in your 'wp-content' directory
// and then making your changes there. When in place, that file will load in place of this one.
// This template opens a list of shows - by default it opens a table,
// but it could also open a list, or be blank if you so desired
<script type="text/javascript">
jQuery(document).ready(function($){
$.equalHeightColumns('destroy');
$('yourselector(s)').equalHeightColumns();
});
</script>
@joshuaiz
joshuaiz / soundcloud_mixin.scss
Created February 12, 2014 21:57
A SCSS @mixin for styling custom SoundCloud widgets
// Here's a little mixin I created to style some custom SoundCloud players
// $size = the size of the arwork box (also size of margins for track info + waveform)
// $title-color = the color of the track title
// $waveform-color = color of the audio waveform
// $play-color = color of the player indicator bar (current track position in playback)
//
// Usage: @include scplayer (60px, #001825, #aaa, #777)
@mixin scplayer($size, $title-color, $waveform-color, $play-color) {