Skip to content

Instantly share code, notes, and snippets.

View j-cam's full-sized avatar

Jamie Campbell j-cam

View GitHub Profile
@j-cam
j-cam / jquery.fancybox-1.3.4_patch.js
Last active July 17, 2018 17:40
Fancybox v1.3.4 compatibility patch for jQuery > v1.8.3
// Source References
// - SO: https://stackoverflow.com/a/14344290/538696
// - picssel.com: http://www.picssel.com/playground/jquery/fancybox/jquery.fancybox-1.3.4_patch.zip
// - GH: https://github.com/nvidoni/fancybox/issues/2#issuecomment-255766623
/*
* FancyBox - jQuery Plugin
* Simple and fancy lightbox alternative
*
* Examples and documentation at: http://fancybox.net
*
@j-cam
j-cam / scss.json
Created April 29, 2018 16:37
VS Code User Snippets SCSS: add @ directives.
{
"@import directive": {
"prefix": "@import",
"body": [
"@import "
],
"description": "import scss/sass partial"
},
"@include directive": {
"prefix": "@include",
page-hero:
headline: |-
<span>Even A SMALL amount of retained blood can cause serious complications.</span>
<strong>1 in 5 patients develop Retained Blood Syndrome (RBS) after heart surgery.</strong>
image: "assets/img/hero-rbs-home.jpg"
button-text: LEARN MORE ABOUT RBS
@j-cam
j-cam / SassMeister-input.scss
Last active April 20, 2017 19:16
3 Grid Columns with one in the middle that's wider than the others (Generated by SassMeister.com)
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
// Three Columns with one that is wider than the others
$module: 'unequal-columns';
.#{$module} {
// Module Variables: contexts from a PSD design file
<?php
if ( !function_exists( 'get_home_path' ) )
require_once( dirname(__FILE__) . '/../../../wp-admin/includes/file.php' );
add_action( 'admin_init', array(&$this, 'has_acf') );
public function has_acf() {
if ( is_admin() && current_user_can( 'activate_plugins' ) && !is_plugin_active( 'advanced-custom-fields-pro/acf.php' ) ) {
add_action( 'admin_notices', array(&$this, 'acf_not_activated_notice') );
@j-cam
j-cam / wp_default_styles_version.php
Last active March 19, 2016 19:10
A function for updating the version in the query string for a theme's default stylesheet.
<?php
/**
* Updates the v= query string for
* theme's default stylesheet for
* browser cache busting etc.
*/
function theme_wp_default_styles_version($styles) {
// use date versioning or semantic versioning
@j-cam
j-cam / wp-post-image-regulator.css
Created January 26, 2016 08:05
Wordpress: Removing Image and Caption Dimension Attributes.
/* Attribution: http://wordpress.stackexchange.com/a/37768/35516 */
.entry-content img,
.comment-content img,
.widget img {
max-width: 97.5%; /* Fluid images for posts, comments, and widgets */
}
img[class*="align"],
img[class*="wp-image-"] {
height: auto; /* Make sure images with WordPress-added height and width >attributes are scaled correctly */
}
@j-cam
j-cam / jr-photo-set-template.txt
Created July 8, 2015 16:02
Template for creating a new photo set post.
<!-- START SLIDE FUNCTIONALITY -->
<script type src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="/storage/js/slides.jquery.js"></script>
<script>
$(function () {
$('#slides').slides({
preload: true,
preloadImage: '/storage/js/loading.jpg',
autoHeight: true,
autoHeightSpeed: 350,
@j-cam
j-cam / jr-photo-set-slides-script.txt
Last active August 29, 2015 14:24
Script for setting slideshow options and adding arrow key functionality for photo set pages.
<!-- START SLIDE FUNCTIONALITY -->
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="/storage/js/slides.jquery.js"></script>
<script>
$(function () {
$('#slides').slides({
preload: true,
preloadImage: '/storage/js/loading.jpg',
autoHeight: true,
autoHeightSpeed: 350,
@j-cam
j-cam / SassMeister-input-HTML.html
Created June 24, 2015 05:43
Generated by SassMeister.com.
<nav class="site-nav">
<ul class="main-menu">
<li class="main-menu__item main-menu__item_home">
<a class="main-menu__anchor" href="#">HOME</a>
</li>
<li class="main-menu__item main-menu__item_products">
<a class="main-menu__anchor" href="#">PRODUCTS</a>
</li>
<li class="main-menu__item main-menu__item_about">
<a class="main-menu__anchor" href="#">ABOUT</a>