Skip to content

Instantly share code, notes, and snippets.

View digiltd's full-sized avatar

Sam Turner digiltd

View GitHub Profile
@kerimdzhanov
kerimdzhanov / random.js
Last active October 8, 2025 02:54
JavaScript: get a random number from a specific range
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {number} a random floating point number
*/
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
}
@corsonr
corsonr / gist:6761916
Created September 30, 2013 10:26
WooCommerce - Remove category products count
/*
*
* Removes products count after categories name
*
*/
add_filter( 'woocommerce_subcategory_count_html', 'woo_remove_category_products_count' );
function woo_remove_category_products_count() {
return;
}
<?php
/*
Plugin Name: Simplecart for WordPress
Plugin URI: http://wp.tutsplus.com/articles/how-to-include-javascript-and-css-in-your-wordpress-themes-and-plugins/#comment-827004468
Description: A very simple plugin to load SimpleCart in WordPress
Version: 1.0
Author: Japh
Author URI: http://wp.tutsplus.com/author/Japh
License: GPL2
*/
@tomjn
tomjn / typekit.editor.php
Created September 10, 2012 10:22
Typekit fonts for TinyMCE editor plugin
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;
}