Skip to content

Instantly share code, notes, and snippets.

Take that, entropy!

Chris Blakley chrisblakley

Take that, entropy!
View GitHub Profile
chrisblakley / google-maps-js-api.php
Created Apr 13, 2017
A too in-depth implementation of Google Maps JS API
View google-maps-js-api.php
jQuery(document).on('ready', function(){
mapInfo = [];
jQuery.getScript('' +, function(){
google.load('maps', '3', {
callback: function(){
chrisblakley / once.js
Created Feb 21, 2016
A function that allows other functions to be called only one time per page load.
View once.js
function once(fn, args, unique){
if ( typeof onces === 'undefined' ){
onces = {};
if ( typeof fn === 'function' ){ //If the first parameter is a function
if ( typeof args === 'string' ){ //If no parameters
args = [];
unique = args;
chrisblakley / admin_functions.php
Last active Jun 26, 2018
Business Hours Custom Field Group without ACF
View admin_functions.php
//Add Open/Closed info to location listing columns
add_filter('manage_edit-location_columns', 'schc_location_hours_columns_head');
function schc_location_hours_columns_head($defaults){
$defaults['openclosed'] = 'Open/Closed';
return $defaults;
add_action('manage_location_posts_custom_column', 'schc_location_hours_columns_content', 15, 3);
function schc_location_hours_columns_content($column_name, $id){
if ( $column_name == 'openclosed' ){
chrisblakley / active_users_metabox.php
Last active Feb 12, 2022
Get data about active WordPress users on your site as well as list when they were last online.
View active_users_metabox.php
This snippet shows how to add an active user count to the WordPress Dashboard.
Copy these contents to functions.php
//Active Users Metabox
add_action('wp_dashboard_setup', 'gearside_activeusers_metabox');
function gearside_activeusers_metabox(){
chrisblakley / event-intent-click.js
Last active Nov 7, 2015
Reduce the amount of speculation when making insights in Google Analytics by using context clues to determine the event intent from user interactions.
View event-intent-click.js
jQuery('a.some-link').on('mousedown tap touch', function(e){
eventIntent = ( e.which >= 2 )? 'Intent' : 'Explicit';
ga('set', 'dimension3', eventIntent);
ga('send', 'event', 'Category', 'Action', 'Label', 'Value');
chrisblakley / cloudflare-dev-mode.js
Created Oct 3, 2015
This is a more complete Cloudflare admin bar functionality. Can definitely be more optimized, but it gets the idea across.
View cloudflare-dev-mode.js
function cloudflareDevModeToggle(toggle){
if ( !toggle ){
toggle = 'on';
jQuery('.devmodeicon').removeClass('fa-bolt fa-medkit').addClass('fa-spin fa-spinner');
type: "POST",
url: bloginfo["admin_ajax"],
chrisblakley / phone_emails.txt
Last active Aug 29, 2015
Mobile phone email addresses. This allows texting to a phone via email. Replace "5551234567" with the actual phone number (with area code).
View phone_emails.txt
3 River Wireless:
ACS Wireless:
chrisblakley / common_referral_spambots.txt
Last active Nov 6, 2016
Common referral spambots that appear in Google Analytics reports. More information on how to use this list:
View common_referral_spambots.txt
chrisblakley / trello_styles.css
Last active Sep 23, 2018
Custom CSS to enchance Trello.
View trello_styles.css
/* Show the move cursor to demonstrate drag/drop scrolling on the interface. */
#board {
cursor: move;
#board .list {
cursor: default;
/* Change the background to a texture while maintaining board color. */