Skip to content

Instantly share code, notes, and snippets.

View craigpotter's full-sized avatar

Craig Potter craigpotter

View GitHub Profile
@craigpotter
craigpotter / YiiValetDriver.php
Created April 8, 2022 08:49
Laravel Valet Yii1.1 Driver
<?php
class YiiValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@craigpotter
craigpotter / id_rsa.pub
Created April 6, 2020 09:10
Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQChIdbqqWt5cvPbL9c2v73BgvbJXTlWj0jpa+T6tzh46y9tcAabxqUrwOUln6W06SxR0vx1+6P6gczBqSy66GguI7iPrav4Cll6R4QvFTmeiiqSFcWnqC88mLVWnQGXD67nAxlxv3jkWoMFYAAAtYI0tVX6GSfOXjsQkhLKVbyZPd/osz2NiSzif15MYRqAdqQ+VbuTu3ZKH96Gxs+uz60mRRH/4dMAyhVkS9PsXL98AN9Kq2aJJbZ6AFv2gXTgIO9El6TmxUJlCgZZVqnVm+wUkxUqQ0WYGJD0o/pBpksMo4AbhTYntBeDpVaG6vxuXyOHaLOet368NH3s9pjiPwVj craig@DESKTOP-3GRC8UG
@craigpotter
craigpotter / equalheightslick.js
Created June 28, 2018 11:43 — forked from proweb/equalheightslick.js
Slick carousel equal height slides
$(window).load(function() {
$('.slides').on('setPosition', function () {
$(this).find('.slick-slide').height('auto');
var slickTrack = $(this).find('.slick-track');
var slickTrackHeight = $(slickTrack).height();
$(this).find('.slick-slide').css('height', slickTrackHeight + 'px');
});
})
@craigpotter
craigpotter / function.php
Last active August 13, 2019 21:53
Rakuten Wordpress/Woocommerce Conversion Script
add_action( 'woocommerce_thankyou', 'cp_custom_rakuten_conversion_tracking' );
function cp_custom_rakuten_conversion_tracking( $order_id ) {
// Lets grab the order
$order = wc_get_order( $order_id );
/**
* Put your tracking code here
@craigpotter
craigpotter / function.php
Created March 25, 2018 00:17
Dynamic Remarketing For Wordpress (New GTag)
function cp_dynamic_remarketing_tag()
{
global $woocommerce;
$adword_code = 'AW-00000001';
if(is_front_page() || is_home()){
?>
<script type="text/javascript">
gtag('event', 'page_view', {
'send_to': '<?php echo $adword_code;?>',
'ecomm_pagetype': 'home'
@craigpotter
craigpotter / ssl_on_wamp.pl
Created August 15, 2017 11:44 — forked from muthuishere/ssl_on_wamp.pl
Setup SSL on WAMP for virtual server Virtual hosts on wamp
set WAMP_INSTALL_LOCATION="c:\wamp" #modify
1. Open command prompt as admin Goto %WAMP_INSTALL_LOCATION%\bin\apache\apache2.x.x\bin>
2. Type => set OPENSSL_CONF=%WAMP_INSTALL_LOCATION%\bin\apache\apache2.x.x\conf\openssl.cnf
@craigpotter
craigpotter / Photostack.min.js
Created December 22, 2016 17:08
Minified version of photostack with ClickToFlip Option
!function(a){"use strict";function e(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function f(a){for(var b=[],c=a.length,d=a[0].length,e=0;c>e;e++)b=b.concat(a[e]);b=g(b);for(var f=[],h=0,i=0;c>i;i++){for(var j=[],k=0;d>k;k++)j.push(b[h]),h++;f.push(j)}return f}function g(a){for(var c,d,b=a.length;b;)d=Math.floor(Math.random()*b--),c=a[b],a[b]=a[d],a[d]=c;return a}function h(a,b){this.el=a,this.inner=this.el.querySelector("div"),this.allItems=[].slice.call(this.inner.children),this.allItemsCount=this.allItems.length,this.allItemsCount&&(this.items=[].slice.call(this.inner.querySelectorAll("figure:not([data-dummy])")),this.itemsCount=this.items.length,this.current=0,this.options=e({},this.options),e(this.options,b),this._init())}Modernizr.addTest("csstransformspreserve3d",function(){var d,b=Modernizr.prefixed("transformStyle"),c="preserve-3d";return b?(b=b.replace(/([A-Z])/g,function(a,b){return"-"+b.toLowerCase()}).replace(/^ms-/,"-ms-"),Modernizr.testStyles("#modernizr{"+b+":"+c+";}",function
@craigpotter
craigpotter / issuu.php
Created August 10, 2012 11:40 — forked from fdc263/issuu.php
Issuu API Client for PHP
<?php
/**
* IssuuClient hooks into Issuu's API
*
* example:
* include 'IssuuClient.php';
* $issuu = new IssuuClient(pubKey, privKey, apiAdr);
* $issuu->openAction('issuu.document.url_upload');
* $issuu->slurpUrl = 'pdfurl.pdf';
* $issuu->executeAction();