Skip to content

Instantly share code, notes, and snippets.

View mcaskill's full-sized avatar
🥃

Chauncey McAskill mcaskill

🥃
View GitHub Profile
@mcaskill
mcaskill / _objects.modal.scss
Created June 17, 2014 21:36
/locomotivemtl/sass/helpers/_stack-context.scss
@import '_zindex.scss'
.modal {
z-index: index($site-order, modals);
.field {
z-index: index($modal-order, fields);
}
.form-controls {

Keybase proof

I hereby claim:

  • I am mcaskill on github.
  • I am mcaskill (https://keybase.io/mcaskill) on keybase.
  • I have a public key whose fingerprint is 9474 2586 E6F7 677D 17C4 E829 C11C ADAB BFC1 D36C

To claim this, I am signing this object:

@mcaskill
mcaskill / _mj.scss
Created November 23, 2014 22:52
A `sass-mq` mixin that uses Jacket
$mq-jacket-support: has-mediaqueries !default;
$mq-jacket-legacy: has-no-mediaqueries !default;
$jacket: append($jacket, $mq-jacket-support) !default;
/// Jacket MQ
///
/// Create a `@media` query based on a named-breakpoint and
/// possibly ignore the wrapper based on the context of $jacket.
///
@mcaskill
mcaskill / modernizr-videoautoplay.js
Last active August 29, 2015 14:13
Checks for support of the autoplay attribute of the video element.
/**
* Checks for support of the autoplay attribute of the video element.
*
* Adapted to work for Modernizr 2, based on the detection feature for Modernizr 3.
*
* @link https://github.com/Modernizr/Modernizr/blob/8d2cb3c92e33c36ed3fd8a5ea6e198b3b26ad07a/feature-detects/video/autoplay.js
*/
Modernizr.addTest('videoautoplay', function(){
var timeout;
@mcaskill
mcaskill / recaptchalib-errors.php
Last active August 29, 2015 14:14
ReCAPTCHA 2 Error Code Parsing
<?php
/**
* Parse ReCAPTCHA API verion 2.0 error codes.
*
* @uses mcaskill\ReCAPTCHA or jmcastagnetto\ReCAPTCHA
* @link https://developers.google.com/recaptcha/docs/verify Error code reference
*
* @param mixed $response A Google\ReCaptcha\Response or null
* @param array $arr If the second parameter $arr is present, error messages are stored in this variable as associative array elements instead.
@mcaskill
mcaskill / wp-get_template_view
Last active August 29, 2015 14:16
WordPress : Load a template part into a template and pass scoped variables
<?php
/**
* Load a template part into a template
*
* Makes it easy for a theme to reuse sections of code in a easy to overload way
* for child themes.
*
* Includes the named template part for a theme or if a name is specified then a
* specialised part will be included. If the theme contains no {slug}.php file
@mcaskill
mcaskill / checkbox-toggle.js
Created March 16, 2015 17:49
Simple checkbox toggling with jQuery
/* global jQuery */
/**
* Simple Checkbox Toggling
*
* Hands-free checked/unchecked toggling for all checkboxes.
*
* Requirements:
* - jQuery
* - `name="foo[]"` -- Name attribute must assign checked values to an array.
@mcaskill
mcaskill / wp-gf-pll-merge_tags.php
Last active August 29, 2015 14:19
WordPress \ Polylang : Adds "current" and "default" language merge tags for Gravity Forms
<?php
if ( ! class_exists('Polylang') ) {
return;
}
/**
* Filter: Replace Polylang merge tags with their respective values
*
* @used-by Filter: GravityForms\'gform_replace_merge_tags'
@mcaskill
mcaskill / wp-gf-wpml-merge_tags.php
Created April 16, 2015 18:37
WordPress \ WPML : Adds "current" and "default" language merge tags for Gravity Forms
<?php
if ( ! class_exists('SitePress') ) {
return;
}
/**
* Filter: Replace WPML merge tags with their respective values
*
* @used-by Filter: GravityForms\'gform_replace_merge_tags'
@mcaskill
mcaskill / wp-wpml-helpers.php
Created April 16, 2015 18:47
WordPress \ WPML : Various utility functions I made but don't remember why or if they work.
<?php
/**
* WPML Utility Functions
*/
if ( ! function_exists('icl_get_object') )
{
/**
* Retrieve an associated translated object from another object's ID.