Skip to content

Instantly share code, notes, and snippets.

View haydenbbickerton's full-sized avatar

Hayden Bickerton haydenbbickerton

  • 00:22 (UTC -05:00)
View GitHub Profile
@haydenbbickerton
haydenbbickerton / functions.php
Created December 3, 2015 18:14
Wordpress The7 with Yoast Breadcrumbs
if (function_exists('yoast_breadcrumb'))
{
function yoastBreadcrumbs()
{
// The start/end html is theme-specific.
return yoast_breadcrumb('<div class="wf-td"><div class="breadcrumbs text-normal" id="breadcrumbs">', '</div></div>', false);
}
// Override the theme's function for making breadcrumbs.
// This is for 'The7' theme, the name of the function is theme-specific.
@haydenbbickerton
haydenbbickerton / custom-items-per-page.xml
Created December 11, 2015 16:20
Opencart (vQmod) Custom Items per Page
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id>Custom Items per Page</id>
<version>0.0.1</version>
<vqmver>2.3.0</vqmver>
<author>Hayden - https://github.com/haydenbbickerton</author>
<file path="catalog/controller/product/" name="category.php,manufacturer.php,search.php,special.php">
<operation error="log" info="Change the limits. The first number is adjusted in Settings > Option > Default Items Per Page">
<search path="path/to/" position="replace"><![CDATA[$limits = array_unique(array($this->config->get('config_catalog_limit'), 25, 50, 75, 100));]]></search>
<add><![CDATA[$limits = array_unique(array($this->config->get('config_catalog_limit'), 32, 64, 128));]]></add>
@haydenbbickerton
haydenbbickerton / functions.php
Created December 21, 2015 17:40
Ninja Forms to Improveit360 ELead
<?php
/*
* Made for use with Ninja Forms and Improveit360,
* should work with others with adjustment.
*
* Based on Alex Hagers Post
* http://www.alexhager.at/how-to-integrate-salesforce-in-contact-form-7/
*/
@haydenbbickerton
haydenbbickerton / adwords_conversion.js
Created January 3, 2016 21:29
Ninja Forms ajax submission to AdWords conversion
/*
Put the Google Conversion Code here
*/
/*
Run our conversion logic after form submissions.
I'm using js-cookie(https://github.com/js-cookie/js-cookie)
to handle the cookie, use whatever you want.
*/
@haydenbbickerton
haydenbbickerton / Heat Map Creation Tool (AST).js
Last active February 4, 2016 05:24 — forked from BrainlabsDigital/Heat Map Creation Tool.js
Script to create smoothed heat maps from your AdWords data
/**
*
* Heat Map Creation Tool
*
* This script calculates the smoothed average performance of each hour of each day
* of the week, and outputs this into a heat map and graph in a Google sheet. It
* also makes suggested bid adjustments based on the click conversion rate.
*
* Version: 1.0
* Google AdWords Script maintained on brainlabsdigital.com
@haydenbbickerton
haydenbbickerton / sample annotate.py
Created April 19, 2017 01:42
Annotations decorator for python 2.7.
def annotate(*args, **kwargs):
'''
Decorator to add PEP 3107 style function annotations, and enforce the types
if desired. Annotations are added as the "__annotations__" attribute.
Can read more here - http://python-future.org/func_annotations.html
Parameters
----------
enforce : bool
@haydenbbickerton
haydenbbickerton / safe_format.py
Created August 25, 2017 22:14
Safe string formatter
class SafeFormat(string.Formatter):
'''String formatting class that won't throw errors for usused/unfound args/kwargs.
Values that can't be retrieved are returned in their original '{keyname}' string
to allow for another round for .format()'ing
Example
-------
>>> safe_format = SafeFormat().format
>>> log_str = 'the {color} dog jumped over the {animal}'
# A small module for judging "risk" of a permission based on service and action
#
# The goal here is to categorize common AWS actions in a way that can be easily referenced by
# either the end user, or internal script, or whatever else.
#
# More of this to come later
from boltons import mathutils, strutils
# Default baseline risk scores, should be configured
S28800011AAK27GA0000DTS000100SH 0000619200Y
S28800012ABK27GA00000KB001000SSO 0000763800Y
S28800012ABK27GA00000LB001000SSO 0000763600Y
S28800012ABK27GA00000MS001000SSO 0000764800Y
S28800012AAK27GA0000DUS001000SDS 0000549300Y
S28800012AAK27GA0000DVB001000SDS 0000548000Y
S28800012AAK27GA0000DWB000100SPY 0001424100Y
S28800012AAK27GA0000DXS000100SPY 0001426300Y
S28800012AAK27GA0000DYB000100SH 0000618500Y
S28800015AAK27GA0000DZB001000SDS 0000547800Y
<template>
<div class="ur-legacy-styles">
<slot></slot>
</div>
</template>
<script>
export default {
name: 'ur-legacy-styles',
};