Skip to content

Instantly share code, notes, and snippets.

View codescribblr's full-sized avatar

Jonathan Wadsworth codescribblr

View GitHub Profile
@codescribblr
codescribblr / window_width.js
Created January 8, 2016 14:24
best cross-browser way to get "actual" window width in js. This replaces the previously used $(window).width() that was unreliable because of the scroll bar. Requires Modernizr.
if (Modernizr.mq('(max-width: 767px)')) {
//...
} else {
//...
}
@codescribblr
codescribblr / functions.php
Created December 16, 2015 16:28
Remove emoji support from wordpress
/**
* Disable the emoji's
*/
function disable_emojis() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
@codescribblr
codescribblr / footer.php
Created November 20, 2015 14:20
Youtube API video background
@codescribblr
codescribblr / tweet.php
Created November 20, 2015 14:11
tweet this snippet for wordpress
<a class="twitter" href="http://twitter.com/intent/tweet?text=<?php echo urlencode(get_the_title().": ".wp_get_shortlink());?>"></a>
@codescribblr
codescribblr / .gitignore
Last active March 14, 2016 15:29
This is the default .gitignore we can use for git repos. It gives a template for including plugins and themes we've modified.From https://bitbucket.org/showcase/wolfpackwholesale.com/src/91cb3cf37a8390f4260e44d49ec04695296ea47a/.gitignore?at=netsuite_integration_plugin
# Ignore everything initially
/*
# General ignore list
# - these ignores are used if I decide to not ignore everything initially
# OSX
.DS_Store
.AppleDouble
.LSOverride
# Remove the www.
RewriteEngine On
RewriteCond %{HTTP_HOST} !^your-site.com$ [NC]
RewriteRule ^(.*)$ http://your-site.com/$1 [L,R=301]
<script type="text/javascript">
//<![CDATA[
jQuery(function($)
{
function my_check_categories()
{
$('#_custom_meta_metabox').hide();
$('#categorychecklist input[type="checkbox"]').each(function(i,e)
@codescribblr
codescribblr / jquery-console.js
Created January 30, 2015 18:42
From http://stackoverflow.com/questions/7474354/include-jquery-in-the-javascript-console This allows you to use jquery in the chrome console for websites that don't have jquery.
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
.col-xs-15,
.col-sm-15,
.col-md-15,
.col-lg-15 {
position: relative;
min-height: 1px;
padding-right: 10px;
padding-left: 10px;
}
.col-xs-15 {
@codescribblr
codescribblr / custom-variations-select.css
Last active June 21, 2025 15:40
Custom Select Box Replacements for Woocommerce Variations
.woocommerce.single-product .product .summary .variations {
width: 100%;
}
.woocommerce.single-product .product .summary .variations td {
display: block;
width: 100%;
}
.woocommerce.single-product .product .summary .variations td label {
font-family: 'Nunito', Helvetica, Arial, sans-serif;
letter-spacing: 0px;