Skip to content

Instantly share code, notes, and snippets.

Avatar

Critter Critter

  • 413-Critter
  • Cary, NC
View GitHub Profile
@Critter
Critter / calendar.js
Created Dec 19, 2022 — forked from Normal-Tangerine8609/calendar.js
A small script to jumpstart your calendar widget.
View calendar.js
/*
* SIMPLE CALENDAR BOILERPLATE
* this is not meant to be a stantalone widget but to be a starter template to jumpstart your calendar widget (or any widget with a calendar).
* dates can be difficult to work with, so this template is here to make it easier
*/
/*
* BASE WIDGET STYLING
* change the below variables to customize your calendar style
*/
@Critter
Critter / acf_custom_search.php
Created Sep 25, 2022 — forked from wking-io/acf_custom_search.php
How to search a specific custom post type and the ACF fields within
View acf_custom_search.php
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* This could easily be something that is added to the admin as a plugin so that users can
* add searchable fields in an options table
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
@Critter
Critter / termiWidget.js
Created Aug 27, 2020 — forked from spencerwooo/termiWidget.js
🍋 TermiWidget - Terminal-like Widget for iOS 14, made with Scriptable.
View termiWidget.js
// 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"
View purpleaqijsnell.js
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()
View wyze_merge.sh
#!/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 / bootstrap-button-toggle-on-off-switch.markdown
Created Jul 26, 2018
Bootstrap Button Toggle (On/Off Switch)
View bootstrap-button-toggle-on-off-switch.markdown

Bootstrap Button Toggle (On/Off Switch)

Working on a client project that will be using Bootstrap, and needed to build a toggle/switch that came in a couple different sizes. I wasn't seeing that as a built-in option within Bootstrap, and I didn't really like the ones already out there that I found from a quick search (I didn't want to use a plugin, just wanted it to utilize Bootstrap's built-in JS), so I decided to make my own.

This example is just using the default "Quick Add" Bootstrap CSS & JS, no added/custom JS on my part, I've simply utilized Bootstrap's buttons.js Single Toggle method (http://getbootstrap.com/javascript/#buttons) and added some custom styling (LESS).

A Pen by Aanjulena Sweet on CodePen.

License.

View bootstrap-vue-toggle-status-switch.markdown
View transmist-mdls-output.txt
Critter:~ critter$ mdls /Applications/Transmit.app/
_kMDItemDisplayNameWithExtensions = "Transmit.app"
_kMDItemRenderData = <09000000 407477c0 41000c>
kMDItemAlternateNames = (
"Transmit.app"
)
kMDItemContentCreationDate = 2018-05-31 21:15:56 +0000
kMDItemContentCreationDate_Ranking = 2018-05-31 00:00:00 +0000
kMDItemContentModificationDate = 2018-06-02 12:56:24 +0000
kMDItemContentType = "com.apple.alias-file"
View include-tickets-partial.php
<?php
tribe_get_template_part( 'wootickets/tickets', null, array(
'tickets' => Tribe__Events__Tickets__Tickets::get_all_event_tickets( get_the_ID() )
) );
?>
@Critter
Critter / ticketsplus_woocommerce-products.php
Created Sep 26, 2017 — forked from theeventscalendar/ticketsplus_woocommerce-products.php
Allows customers to access the WooCommerce product page for tickets with Tickets Plus
View ticketsplus_woocommerce-products.php
<?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 );