Skip to content

Instantly share code, notes, and snippets.

View Critter's full-sized avatar

Critter Critter

View GitHub Profile
<?php
/*
* replace icons in Social Media Feather with custom icons
* @ref: http://wordpress.org/plugins/social-media-feather/
*/
add_filter('synved_social_skin_image_list', 'custom_social_feather_icons');
function custom_social_feather_icons($image_list) {
@Critter
Critter / How_to_use.php
Last active August 29, 2015 14:08 — forked from hakre/gist:826061
WP_Query Columns
<?php foreach(new WP_Query_Columns($the_query, 10) as $column_count) : ?>
<ul>
<?php while ($column_count--) : $the_query->the_post(); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
<?php endforeach; ?>
<?php
/*
Plugin Name: Convert Custom Taxonomy to Custom Post Type
Plugin URI: N/A
Description: A plugin to convert a Custom Taxonomy to a Custom Post Type and transfer associated metadata.
Version: 0.1
Author: Strap1
Author URI: http:/www.hiphopinenglish.com
/** Convert Taxonomy '%name%' to CPT '%name%' **/
@Critter
Critter / FCPrivateBatteryStatus.m
Created January 30, 2016 00:36
How to get raw battery info (mAh remaining, etc.) from iOS using private APIs. For internal testing only, NOT APP STORE DISTRIBUTION!
#import <Foundation/Foundation.h>
#include <dlfcn.h>
NSDictionary *FCPrivateBatteryStatus()
{
static mach_port_t *s_kIOMasterPortDefault;
static kern_return_t (*s_IORegistryEntryCreateCFProperties)(mach_port_t entry, CFMutableDictionaryRef *properties, CFAllocatorRef allocator, UInt32 options);
static mach_port_t (*s_IOServiceGetMatchingService)(mach_port_t masterPort, CFDictionaryRef matching CF_RELEASES_ARGUMENT);
static CFMutableDictionaryRef (*s_IOServiceMatching)(const char *name);
@Critter
Critter / functions.php
Created September 26, 2017 20:32 — forked from cliffordp/functions.php
Event Tickets Plus and WooCommerce: Set child input based on forced quantity sync with parent input.
<?php
/**
* Event Tickets Plus and WooCommerce:
* Set child input based on forced quantity sync with parent input.
*
* You need to edit the product IDs (1129 parent and 1128 child in this example code)
*
* From https://gist.github.com/cliffordp/5a769159a2bf64f0b1b1dbbde243d109
* GIF preview: https://cl.ly/1F1N0h211b1w
*
@Critter
Critter / ticketsplus_woocommerce-products.php
Created September 26, 2017 20:37 — forked from theeventscalendar/ticketsplus_woocommerce-products.php
Allows customers to access the WooCommerce product page for tickets with Tickets Plus
<?php
/*
* Causes WooCommerce Ticket product pages to stop redirecting to their event page
* See https://theeventscalendar.com/knowledgebase/selling-tickets-from-the-woocommerce-products-page/
*/
function tribe_wootix_no_hijack() {
if ( ! class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' ) ) return;
$woo_tickets = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
remove_filter( 'post_type_link', array( $woo_tickets, 'hijack_ticket_link' ), 10, 4 );
<?php
tribe_get_template_part( 'wootickets/tickets', null, array(
'tickets' => Tribe__Events__Tickets__Tickets::get_all_event_tickets( get_the_ID() )
) );
?>
@Critter
Critter / wyze_merge.sh
Created January 22, 2020 20:43 — forked from kdvlr/wyze_merge.sh
Wyze Merge
#!/bin/bash
# Config
echo "---------Starting Wyze Merge at $(date)-----------"
SRC_DIR=/cameras/WyzeCams
# Assumes there is a camera specific folder with record folder inside it.
# E.g. SRC_DIR/<Camera>/record
TGT_DIR=/cameras/Archive
TMP_DIR=/tmp/wyze_merge
echo "Source Directory is $SRC_DIR"
@Critter
Critter / purpleaqijsnell.js
Created August 27, 2020 03:09 — forked from jasonsnell/purpleaqijsnell.js
Purple AQI Widget
const API_URL = "https://www.purpleair.com/json?show=";
// const CACHE_FILE = "aqi_data.json"
// Find a nearby PurpleAir sensor ID via https://fire.airnow.gov/
// Click a sensor near your location: the ID is the trailing integers
// https://www.purpleair.com/json has all sensors by location & ID.
let SENSOR_ID = args.widgetParameter || "4896"
async function getSensorData(url, id) {
let req = new Request(`${url}${id}`)
let json = await req.loadJSON()
@Critter
Critter / termiWidget.js
Created August 27, 2020 13:54 — forked from spencerwooo/termiWidget.js
🍋 TermiWidget - Terminal-like Widget for iOS 14, made with Scriptable.
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: orange; icon-glyph: quote-right;
// Change these to your usernames!
const user = "spencer"
const jike = "4DDA0425-FB41-4188-89E4-952CA15E3C5E"
const telegram = "realSpencerWoo"
const github = "spencerwooo"