Skip to content

Instantly share code, notes, and snippets.

View simplistik's full-sized avatar

Lucas Williams simplistik

View GitHub Profile
@simplistik
simplistik / gist:2001892
Created March 8, 2012 16:22
htaccess: Firefox x-domain font embed
<FilesMatch "\.(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
@simplistik
simplistik / gist:2001897
Created March 8, 2012 16:22
htaccess: Force PDF download
<FilesMatch "\.(?i:pdf)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
@simplistik
simplistik / gist:3859017
Created October 9, 2012 14:04
Wordpress: Compile LESS & Wordpress with lessphp
<?php
/**
* Compile a LESS file in Wordpress with lessphp while preserving the comment meta.
* @param string $less_fname LESS input file path
* @param string $css_fname CSS output file path
*/
function auto_compile_less($less_fname, $css_fname)
{
// WP 3.4 Setup
$theme_meta = array();
<?php
class Client extends Setup
{
public function __construct()
{
add_filter('process_markdown', array($this, 'process_markdown'));
add_filter('tablepress_cell_content', array($this, 'process_markdown'));
}
public function process_markdown($text)
@simplistik
simplistik / tprt-acf-front-end-form-ajax.js
Last active August 5, 2022 22:06
Convert ACF (Advanced Custom Fields) front-end forms into an AJAX submitted form. Disabling page refresh.
/* eslint-disable */
/**
* Disables the refresh logic that ACF front-end forms uses in favor
* of a custom AJAX submission.
*
* This was tested with ACF 5.12.3
*
* This logic makes a few assumptions:
* 1. ACF is queued and your script is properly defining it as a dependency.
@simplistik
simplistik / functions.php
Last active August 5, 2022 22:17
Exclude specific post types from ACFE single_meta filter
<?php
add_filter( 'acfe/modules/single_meta/post_types', 'tprt_control_single_meta_post_types' );
function tprt_control_single_meta_post_types( $post_types ) {
/**
* Exclude specific post types from saving as single meta
*
* If you are not using ACFE to register your post types you
* can skip steps 03 - 05a (comment or delete) and go
@simplistik
simplistik / fl-counties.txt
Created June 9, 2023 15:50
Florida Counties List
Alachua
Baker
Bay
Bradford
Brevard
Broward
Calhoun
Charlotte
Citrus
Clay
@simplistik
simplistik / functions.php
Last active April 2, 2024 15:45
Fetch WP "posts" in chunks.
<?php
/**
* Fetch posts in chunks.
*
* This function fetches posts in chunks of a specified size, which can be useful for large datasets.
*
* @param string $post_type The type of post to fetch. Default is 'post'.
* @param int $posts_per_page The number of posts to fetch per page. Default is 100.
* @param array $custom_args Custom arguments to pass to WP_Query. Default is an empty array.
*
@simplistik
simplistik / RGS_SAVE_PULL.py
Last active January 10, 2024 23:24
Remnant 2: Xbox GamePass (PC), RemnantSaveGuardian save file generator
import os
import shutil
import getpass
import time
# Set debug variable
debug = False
# Searches for a folder containing 'containers.index' within the given root_folder.
def find_save_folder(root_folder):