Skip to content

Instantly share code, notes, and snippets.

View morgyface's full-sized avatar

Dan morgyface

View GitHub Profile
@rosswintle
rosswintle / gist:6635876
Created September 20, 2013 10:52
Code to convert Gravity Forms file uploads to media items and attach to a post.
/*
* There are a couple of places where we use GravityForms to do a file upload into a
* meta-data item of type "upload". The upload file type stores an attachment ID,
* whereas the Gravity Forms upload field stores a URL.
*
* This function is used to convert a URL in the meta-data item specified by the
* $field parameter to an attachment ID - creating the attachment as it goes.
*
* This function should be called from a callback hooked to gform_after_submission_[x]
*
@jlittlejohn
jlittlejohn / gist:6001772
Created July 15, 2013 17:28
SCSS: Background Size (Mixin)
@mixin background-size($background-size) {
-webkit-background-size: $background-size;
-moz-background-size: $background-size;
-o-background-size: $background-size;
background-size: $background-size;
}