Skip to content

Instantly share code, notes, and snippets.

View travismillerweb's full-sized avatar

Travis Miller travismillerweb

View GitHub Profile
@travismillerweb
travismillerweb / refund.php
Created May 3, 2024 19:49 — forked from growdev/refund.php
Bulk Refund WooCommerce Orders using CSV file input.
<?php
/**
* Bulk Refund Orders
*
* This script expects a csv file with following columns:
* - Order ID 1002
* - Reason for refund 'Item was oversold.'
* - Amount to refund '34.56'
* - Refund payment true/false
* - Restock item true/false
@travismillerweb
travismillerweb / remove-duplicate.js
Created January 3, 2014 22:10
JS - Remove Duplicate Elements (If More Than One)
/*
JS - Remove Duplicate Elements (If More Than One)
E.g. Removing duplicate breadcrumb items if there are intentially multiple copies of elements
Reference Link: http://stackoverflow.com/questions/2822962/jquery-remove-duplicate-elements
*/
@travismillerweb
travismillerweb / social-icons-mixin.scss
Created January 29, 2014 08:24
Sass - Social Media Icons Mixin
// Use with the naming convention for files
$social: "facebook", "twitter", "instagram";
@mixin social-icons {
&.social {
background-repeat: no-repeat;
transition:all 0.2s ease;
@travismillerweb
travismillerweb / list-custom-post-type-posts-with-ajax.PHP
Created October 7, 2021 13:33 — forked from mikeschinkel/list-custom-post-type-posts-with-ajax.PHP
Shows how to create a widget with a dropdown list of posts for a given post type and then retrieve HTML specific to the selected post via AJAX to insert into the page.
<?php
/*
List_Custom_Post_Type_Posts_with_AJAX class.
Shows how to create a widget with a dropdown list of posts for a given post type and
then retrieve HTML specific to the selected post via AJAX to insert into the page.
Yes, the name of the class is insanely long in hopes that you'll be forced to think
about what would be a better name.
@travismillerweb
travismillerweb / snap-to-section.js
Created March 4, 2014 09:56
JS - Snap To Section
/*
JS - Snap To Section
Snaps elements to the section as users scroll
Reference Link: http://stackoverflow.com/questions/6800404/scrollable-panel-snap-to-elements-on-scroll
*/
@travismillerweb
travismillerweb / matchmedia.js
Created March 30, 2014 17:03
JS - Match Media Function
/*
JS - Media Match Function
Use JavaScript's matchMedia Method to detect the type of device you are using, and invoke/activate functions based on those criteria.
Reference Links:
http://davidwalsh.name/orientation-change
http://davidwalsh.name/device-state-detection-css-media-queries-javascript
http://www.slideshare.net/DavidKnight5/howto-match-media-25008199
@travismillerweb
travismillerweb / scroll-shadow.css
Created September 23, 2013 18:57
CSS - Google Scroll Shadow
/*
Gmail/Google Reader Sidebar Scroll Shadows
-------------------------------------------
Neat effect that mimics the scroll shadows that appear in the GOogle sitde bar and visually cues users to scroll up or down depending on their position.
Credit goes to Lea Verou for this awesome find.
Source:
Lea's Talk: http://www.youtube.com/watch?v=3ikye7Qc7Ak
Code Source: http://lea.verou.me/more-css-secrets/#slide9
@travismillerweb
travismillerweb / style-before-after.js
Created February 18, 2014 21:40
JS - Style Before and After Elements
/*
JS - Style Before and After Elements
Reference Site: http://davidwalsh.name/ways-css-javascript-interact
*/
// Get the color value of .element:before
var color = window.getComputedStyle(
@travismillerweb
travismillerweb / back-to-top.js
Last active April 16, 2018 18:00
JS - Back To Top Animation
/*
Back To Top Script (and CSS)
Your Classic Back To Top Script that everyone has come to love. Had to make one for one of my projects that was way to long
so I decided to learn how to do it from scratch following a tutorial on net.tutsplus.com
Reference:
http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/quick-tip-implement-a-sticky-back-to-top-button/
@travismillerweb
travismillerweb / controller.php
Created August 12, 2012 18:58
PHP - Simple MVC
<?php
class Controller
{
public $load;
public $model;
function __construct()
{