Skip to content

Instantly share code, notes, and snippets.

View Chrisedmo's full-sized avatar

Chris Mousdale Chrisedmo

View GitHub Profile
@Chrisedmo
Chrisedmo / typekit.editor.php
Last active August 29, 2015 14:23 — forked from tomjn/typekit.editor.php
WP: Add Typekit JS to Render fonts in Admin
add_filter("mce_external_plugins", "tomjn_mce_external_plugins");
function tomjn_mce_external_plugins($plugin_array){
$plugin_array['typekit'] = get_template_directory_uri().'/typekit.tinymce.js';
return $plugin_array;
}
@Chrisedmo
Chrisedmo / WP-simple-slick-slider.php
Last active August 29, 2015 14:13
Wordpress: Simple optionTree + Slick gallery
<div class="image-banner">
<?php $banner_slider = get_post_meta( $post->ID, 'tpa_banner_slider', true ); ?>
<?php if (!empty($banner_slider)): ?>
<?php $banner_slider = explode(",",$banner_slider);
foreach ($banner_slider as $imageID) :?>
<?php $image_src = wp_get_attachment_image_src($imageID, 'full'); ?>
<div>
<img src="<?php echo $image_src[0];?>"/>
@Chrisedmo
Chrisedmo / sublime-icloud.txt
Created November 11, 2014 13:53
Sync Sublime Text Plugins iCloud Drive
Sublime Text Plugins iCloud Drive
First Machine
On your first machine, use the following instructions.
$ cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/
$ mkdir ~/Library/Mobile\ Documents/com\~apple\~CloudDocs/Web\ Dev/Plugins
$ mv User ~/Library/Mobile\ Documents/com\~apple\~CloudDocs/Web\ Dev/Plugins
$ ln -s ~/Library/Mobile\ Documents/com\~apple\~CloudDocs/Web\ Dev/Plugins/User
@Chrisedmo
Chrisedmo / WP-CleanMenu.php
Last active August 29, 2015 14:08
WP: Clean Menu
// REMOVE JUNK FROM MENU
add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1);
add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1);
add_filter('page_css_class', 'my_css_attributes_filter', 100, 1);
function my_css_attributes_filter($var) {
return is_array($var) ? array() : '';
}
@Chrisedmo
Chrisedmo / terminal
Created May 6, 2014 19:32
Error: Running NPM / Node commands as root
http://aralbalkan.com/scribbles/npm-install-g-please-try-running-this-command-again-as-root-administrator/
Enter this into the terminal:
sudo chown -R $USER /usr/local
@Chrisedmo
Chrisedmo / less-colours.less
Created August 13, 2013 09:11
Generate colour schemes from single colour with LESS
// LESS COLOUR SCHEMES
// Complementary Color Scheme
@base: #663333;
@complement1: spin(@base, 180);
@complement2: darken(spin(@base, 180), 5%);
@lighten1: lighten(@base, 15%);
@lighten2: lighten(@base, 30%);
// Implementation
@Chrisedmo
Chrisedmo / dabblet.css
Created August 12, 2013 21:11
Cool CSS3 Pop out search boxes
/**
* Cool CSS3 Pop out search boxes
*/
/* reset webkit search input browser style */
input {
outline: none;
}
input[type=search] {
-webkit-appearance: textfield;
@Chrisedmo
Chrisedmo / dabblet.css
Created August 12, 2013 21:03
Untitled
.disc-wrap {width: 300px; height: 300px; margin: 0 auto;}
.disc-wrap:hover > li {opacity: 0.5;}
.disc-wrap:hover > li:hover {opacity: 1;}
ul {margin: 0; padding: 0;}
li {list-style: none; width: 150px; height: 150px;float: left; background-color: #eee; text-align: center;}
li:hover {transform: scale(1.25)}
li:nth-child(1) {border-top-left-radius: 100%;background-color:red; transform-origin: bottom right;}
li:nth-child(2) {border-top-right-radius: 100%;background-color:lightblue;transform-origin: bottom left}
li:nth-child(3) {border-bottom-left-radius: 100%;background-color:orange;transform-origin: top right}
li:nth-child(4) {border-bottom-right-radius: 100%;background-color:darkgreen;transform-origin: top left}
.disc-wrap {width: 300px; height: 300px; margin: 0 auto;}
.disc-wrap:hover > li {opacity: 0.5;}
.disc-wrap:hover > li:hover {opacity: 1;}
ul {margin: 0; padding: 0;}
li {list-style: none; width: 150px; height: 150px;float: left; background-color: #eee; text-align: center;}
li:hover {transform: scale(1.25)}
li:nth-child(1) {border-top-left-radius: 100%;background-color:red; transform-origin: bottom right;}
li:nth-child(2) {border-top-right-radius: 100%;background-color:lightblue;transform-origin: bottom left}
li:nth-child(3) {border-bottom-left-radius: 100%;background-color:orange;transform-origin: top right}
li:nth-child(4) {border-bottom-right-radius: 100%;background-color:darkgreen;transform-origin: top left}
@Chrisedmo
Chrisedmo / SHOPIFY: Percentage Discount Saved
Created May 2, 2013 19:00
SHOPIFY: How To Show Percentage Discount Saved
{% comment %}How To Show Percentage Discount Saved{% endcomment %}
{% if product.compare_at_price_max > product.price %}You save {{ product.compare_at_price_max | minus: product.price | times: 100.0 | divided_by: product.compare_at_price_max | money_without_currency | times: 100 | remove: ‘.0′}}%{% endif %}