Skip to content

Instantly share code, notes, and snippets.

View KevinBatdorf's full-sized avatar
⚔️
I am undefined

Kevin Batdorf KevinBatdorf

⚔️
I am undefined
View GitHub Profile
@KevinBatdorf
KevinBatdorf / functions.php
Created August 25, 2017 17:40
Disable touch events on MetaSlider for FlexSlider
<?php
function add_pause_on_action($options) {
return array_merge($options, ['touch' => 'false']);
};
add_filter('metaslider_flex_slider_parameters', 'add_pause_on_action');
@KevinBatdorf
KevinBatdorf / .zshrc
Last active April 29, 2018 06:13
.zshrc Win10
# SOME NOTES
#
# Install apt-cyg after cygwin
#
# Make sure to install packages from cygwin instead of choco
# cURL, for example, won't work. Also, install PHP with extensions.
# php php-json php-mbstring php-phar php-posix php-zip
export ZSH=/home/Kevin/.oh-my-zsh
@KevinBatdorf
KevinBatdorf / after.sh
Last active August 12, 2018 12:42
Homestead after.sh Win10
#!/bin/sh
# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
if [ ! -f /usr/local/extra_homestead_software_installed ]; then
echo 'installing some extra software'
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# ZSH_THEME="robbyrussell"
@KevinBatdorf
KevinBatdorf / metaslider-disable-jetpack.php
Created May 28, 2019 17:27
Jetpack breaks images on MetaSlider, and this disabled JetPack from doing so.
<?php
add_filter('jetpack_photon_skip_image', 'metaslider_remove_jetpack', 10, 2);
add_filter('jetpack_lazy_images_skip_image_with_attributes', 'metaslider_remove_jetpack', 10, 2);
function metaslider_remove_jetpack($val, $src) {
// The lazy load filter send the src as a param
$src = isset($src['src']) ? $src['src'] : $src;
// Get an array of slideshow images
@KevinBatdorf
KevinBatdorf / nginx-expires-nextgen
Last active June 8, 2019 17:39
nginx webp express + expires to add to an existing nginx config
# There is a lot of stuff before here
location ~* \.(css|js|ico|gif|webp|svg|eot|otf|woff|woff2|ttf|ogg)$ {
expires 365d;
}
location ~* ^/?content/.*\.(png|jpe?g)$ {
add_header Vary Accept;
expires 365d;
if ($http_accept !~* "webp") {
@KevinBatdorf
KevinBatdorf / ThemosisValetDriverOld.php
Last active December 2, 2019 16:27
Laravel Valet driver for Themosis v1.3
<?php
class ThemosisValetDriverOld extends BasicValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@KevinBatdorf
KevinBatdorf / wp-support-add-live-preview-userscript.js
Created March 8, 2020 21:12
Adds a live preview window for support on WP.org
// ==UserScript==
// @name WP Support Live Preview
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://wordpress.org/support/*
// @grant none
// ==/UserScript==
@KevinBatdorf
KevinBatdorf / latest -toggl-tasks.php
Last active March 28, 2020 14:57
This will show your tasks for a particular workspace since Monday
<?php
$key = YOUR_API_KEY;
$workspace = '2385201'; // Your team workspace
$curl = curl_init();
if (!$curl) {
die("Couldn't initialize a cURL handle");
}
@KevinBatdorf
KevinBatdorf / remove-alpine-js-from-tailwind.js
Last active April 8, 2020 16:03
Filter unwanted AlpineJS attributes from Tailwind UI components
// ==UserScript==
// @name Filter unwanted AlpineJS attributes from Tailwind UI components
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Remove Alpine JS code from Tailwind Ui copy/paste
// @author https://github.com/KevinBatdorf
// @match https://tailwindui.com/components/*
// @grant none
// ==/UserScript==
const code = document.querySelectorAll('[x-ref=clipboardCode]')