Skip to content

Instantly share code, notes, and snippets.

@diekaines
diekaines / filter.txt
Created February 24, 2022 01:59 — forked from chocolatkey/filter.txt
Bypass Komiflo region detection (add to ublock origin filter)
||region-test.komiflo.com/region-test.gif$image,redirect=1x1-transparent.gif,domain=komiflo.com
@diekaines
diekaines / functions.php
Created November 23, 2017 23:34 — forked from AustinGil/functions.php
AJAX load more posts
function assets() {
// enqueue your script
wp_enqueue_script('handle', get_template_directory_uri() . '/path/to/main.js', ['jquery'], '$ver', true);
// localize script
wp_localize_script('handle', 'custom_ajaxify', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
}
add_action('wp_enqueue_scripts', 'assets', 100);
/**
* AJAX load template part
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<script>
var ajaxurl = '<?php echo site_url() ?>/wp-admin/admin-ajax.php';
var true_posts = '<?php echo serialize($wp_query->query_vars); ?>';
var current_page = <?php echo (get_query_var('paged')) ? get_query_var('paged') : 1; ?>;
var max_pages = '<?php echo $wp_query->max_num_pages; ?>';
</script>
<div id="true_loadmore" class="btn">Load more</div>
<?php endif; ?>
@diekaines
diekaines / gettext-filter-multiple.php
Created March 25, 2017 09:59 — forked from BFTrick/gettext-filter-multiple.php
Use the gettext WordPress filter to change any translatable string.
<?php
/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Sale!' :
$translated_text = __( 'Clearance!', 'woocommerce' );
@echo off
:: FOR THIS SCRIPT TO GENERATE PRETTY URLS YOU MUST ADD WP_CLI_CONFIG_PATH=%USERPROFILE%\.wp-cli\config.yml to your user/system environment variables
:: in config.yml you must specify apache_modules: - mod_rewrite
:: Important variables
SET ROOT=C:\wamp\www
SET DBUSER=root
SET DBPASS=
@diekaines
diekaines / wp-cli-powershell.ps1
Created February 21, 2017 21:41
Powershell wp-cli
#version 0.1
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True)]
[string]$Database_Name,
[Parameter(Mandatory=$True)]
[string]$FullUrl
@diekaines
diekaines / ST3
Created September 28, 2016 11:43
{
"always_show_minimap_viewport": true,
"always_show_sidebar": true,
"atomic_save": false,
"bold_folder_labels": true,
"close_windows_when_empty": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"default_encoding": "UTF-8",
"default_line_ending": "unix",
"drag_text": false,
@diekaines
diekaines / gist:d4b9d924b519ab08f52e
Created February 23, 2016 08:49 — forked from bbirdme/woocommerce_by_tags.php
List WooCommerce products by tags
<?php
/**
* Plugin Name: WooCommerce - List Products by Tags
* Plugin URI: http://www.remicorson.com/list-woocommerce-products-by-tags/
* Description: List WooCommerce products by tags using a shortcode, ex: [woo_products_by_tags tags="shoes,socks"]
* Version: 1.0
* Author: Remi Corson
* Author URI: http://remicorson.com
* Requires at least: 3.5
* Tested up to: 3.5
@diekaines
diekaines / ESP8266-12 nokia 5510
Last active October 4, 2019 15:46
ESP8266-12 LCD nokia 5510
/*
* SCHEMATIC http://i.imgur.com/plwZbFa.png
*
* Connecting ESP8266 (ESP-12) and Nokia 5110 LCD
* www.KendrickTabi.com
* http://www.kendricktabi.com/2015/08/esp8266-and-nokia-5110-lcd.html
*/
#include <ESP8266WiFi.h>
#include <ArduinoJson.h>
/**
*
* Filter gateways on specific category ID
*
**/
function filter_gateways($gateways){