Skip to content

Instantly share code, notes, and snippets.

🎣
gone fishin'

Timmy Crawford timmyc

🎣
gone fishin'
  • Automattic
Block or report user

Report or block timmyc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@timmyc
timmyc / disable-jetpack-woocommerce-analytics.php
Created Jul 24, 2019
remove WooCommerce Analytics from Jetpack
View disable-jetpack-woocommerce-analytics.php
<?php
/**
* @package Disable_Jetpack_WooCommerce_Analytics
* @version 1.0.0
*/
/*
Plugin Name: Disable Jetpack WooCommerce Analytics
Plugin URI: https://github.com/Automattic/jetpack
Description: This plugin disables the Jetpack WooCommerce Analytics module
Version: 1.0.0
View fix-printful-woocommerce-3.6.diff
Index: printful-shipping.php
===================================================================
--- printful-shipping.php (revision 2054638)
+++ printful-shipping.php (working copy)
@@ -63,7 +63,6 @@
require_once 'includes/class-printful-admin-support.php';
require_once 'includes/class-printful-size-chart-tab.php';
require_once 'includes/class-printful-size-chart-tab.php';
- require_once 'includes/class-printful-rest-api-controller.php';
View gist:e41748741d2dbbd9e003f85827f5ead6
diff --git a/includes/api/class-wc-rest-reports-revenue-stats-controller.php b/includes/api/class-wc-rest-reports-revenue-stats-controller.php
index 7dbbe00..8c289e3 100644
--- a/includes/api/class-wc-rest-reports-revenue-stats-controller.php
+++ b/includes/api/class-wc-rest-reports-revenue-stats-controller.php
@@ -62,22 +62,26 @@ class WC_REST_Reports_Revenue_Stats_Controller extends WC_REST_Reports_Controlle
$reports_revenue = new WC_Reports_Revenue_Query( $query_args );
$report_data = $reports_revenue->get_data();
+ $totals = $report_data ? $report_data->totals : array();
+ $intervals = $report_data ? $report_data->intervals : array();
@timmyc
timmyc / gist:e4ed93c9e8087c42b406
Created Dec 18, 2014
jsxhint pre-commit hook
View gist:e4ed93c9e8087c42b406
#!/bin/sh
files=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx*$")
if [ "$files" = "" ]; then
exit 0
fi
pass=true
echo "\nValidating .jsx and .js:\n"
View install-comodo-ssl-cert-for-nginx.rst

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@timmyc
timmyc / order_decorator.rb
Created Apr 14, 2013
/app/decorators/models/piggybak/order_decorator.rb
View order_decorator.rb
Piggybak::Order.class_eval do
has_many :packages
end
@timmyc
timmyc / clicky_stats_pie_chart.js
Created Sep 13, 2012
Highcharts + Clicky Mashup
View clicky_stats_pie_chart.js
$("#clicky-chart").click(function(){
var sd = '<%= @sd.to_date %>';
var ed = '<%= @ed.to_date %>';
$(this).hide();
$.getJSON('http://api.getclicky.com/api/stats/4?site_id=<%= @store.clicky %>&sitekey=<%= @store.clicky_key %>&type=traffic-sources&date=' + sd + ',' + ed + '&output=json&json_callback=?',function(data){
var sources = data[0].dates[0].items;
var series_data = [];
for(var i=0; i<sources.length; i++){
var source = sources[i];
series_data.push({
@timmyc
timmyc / twilio_calls_controller.rb
Created Feb 9, 2012 — forked from mshafrir/twilio_calls_controller.rb
Twilio Request Validation for Rails
View twilio_calls_controller.rb
class TwilioCallsController < ApplicationController
before_filter :authenticate_twilio_request, :only => [
:twilio_handling_method_1, :twilio_handling_method_2
]
def twilio_handling_method_1
# do something Twilio-related
end
def twilio_handling_method_2
View Sparrow+SI.h
//
// Sparrow+SI.h
//
#import <UIKit/UIKit.h>
@interface SPUtils (DeviceAdditions)
+ (BOOL)isDevicePad;
+ (BOOL)isDeviceRetina;
@end
View gist:1568641
shows = [{venue_id : 1, venue : 'The Showbox', date : '', acts : 'Pearl Jam,Soundgarden', featured : false, lat : '', long : ''},{venue_id : 2, venue : 'The Croc', date : '', acts : 'Sweeetwater', featured : false, lat : '', long : ''},{venue_id : 3, venue : 'Paramount', date : '', acts : 'Alice in Chains', featured : false, lat : '', long : ''},{venue_id : 1, venue : 'The Showbox', date : '', acts : 'Blue Scholars', featured : false, lat : '', long : ''}];
venues = {};
_.each(shows, function(o){ venues[o.venue_id] = o });
unique_venues = _.values(venues);
You can’t perform that action at this time.