Skip to content

Instantly share code, notes, and snippets.

View djcowan's full-sized avatar

djcowan djcowan

View GitHub Profile
@djcowan
djcowan / font-stacks.css
Created November 10, 2022 03:12 — forked from don1138/font-stacks.css
CSS Modern Font Stacks
/* Modern Font Stacks */
/* System */
font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
/* System (Bootstrap 5.2.0) */
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
/* Times New Roman-based serif */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
@djcowan
djcowan / ajax-search-form.liquid
Created December 14, 2021 02:27 — forked from atikju/ajax-search-form.liquid
Shopify Ajax Search
{% comment %}
This file can be added as a snippet and add it anywhere you want to display
{% endcomment %}
<div id="pageheader">
<div class="util-area">
<div class="search-box">
<form class="search-form" action="/search" method="get" _lpchecked="1">
<i class="icon-mag"></i>
<input type="text" name="q" placeholder="Search" autocomplete="off">
<input type="submit" value="→">
@djcowan
djcowan / wpmudev-forminator-send-input-ajax-request.php
Created November 19, 2021 10:58 — forked from wpmudev-sls/wpmudev-forminator-send-input-ajax-request.php
[Forminator Pro] - Make an AJAX request upon an input
<?php
/**
* Plugin Name: [Forminator Pro] - Make an AJAX request upon an input
* Plugin URI: https://premium.wpmudev.org/
* Description: Send an AJAX request when an input is filled (as of 1.11.3)
* Author: Alessandro Kaounas @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* Task: 0/1135022585412927/1164144055767340
* License: GPLv2 or later
*/
<?php
class ClassRegistry {
/**
* @var array The store for all objects
*/
private array $store = [];
/**
@djcowan
djcowan / functions.php
Created December 1, 2019 00:42 — forked from corsonr/functions.php
Display WooCommerce product variations dropdown select on the shop page
<?php
// Display variations dropdowns on shop page for variable products
add_filter( 'woocommerce_loop_add_to_cart_link', 'woo_display_variation_dropdown_on_shop_page' );
function woo_display_variation_dropdown_on_shop_page() {
global $product;
if( $product->is_type( 'variable' )) {
@djcowan
djcowan / readyExec.js
Created May 24, 2016 12:28 — forked from miguel-perez/readyExec.js
How to add the ability to re-run $(document).ready() functions
/**
* Replace jQuery's $.fn.ready() function with a mod exec
*
* Sites that make heavy use of the $(document).ready function
* are generally incompatable with asynchrounous content. The
* the $.fn.ready function only runs once. This script replaces
* the ready function with a module execution controller that
* let's us register functions and execute all of the functions
* as we need them. This is useful after HTML gets injected on the
* page and we want to rebind functionally to the new content.