Skip to content

Instantly share code, notes, and snippets.

View tylerlwsmith's full-sized avatar

Tyler Smith tylerlwsmith

View GitHub Profile
@tylerlwsmith
tylerlwsmith / acf-google-maps.php
Created April 11, 2018 11:08
JavaScript-free implementation of Google Maps with WordPress Advanced Custom Fields
<?php
/**
* Set constants for Google Maps JS API key--used for ACF's backend map--and Google Maps
* Embed API Key, used for generating maps on the site front end.
*
* @link https://developers.google.com/maps/documentation/javascript/get-api-key
* @link https://developers.google.com/maps/documentation/embed/get-api-key
*/
const GOOGLE_MAPS_JS_API_KEY = 'MAPS-JS-API-KEY';
<?php
class MyTheme
{
private function actionAfterSetup($function)
{
add_action('after_setup_theme', function() use ($function) {
$function();
});
}
@tylerlwsmith
tylerlwsmith / cpt-example.php
Last active November 10, 2019 16:40
Custom Post Rewrites for Josh
<?php
/*
Plugin Name: Example Custom Post Types
Plugin URI: https://deadhandmedia.com/
Description: Adds custom post types and taxonomies.
Version: 1.0.0
Author: Tyler Smith
Author URI: https://deadhandmedia.com/
License: GPL2
@tylerlwsmith
tylerlwsmith / paste-this-into-console.js
Created June 9, 2019 18:22
Get all Facebook friends' names from friends page
scrollToBottomOfPage = {
// Configurable properties
interval: 1000,
allowedIntervalsInSamePosition: 10,
// Non-configurable properties
intervalContainer: null,
currentPosition: 0,
intervalsInSamePosition: 0,
callbackWhenFinished: function(){
console.log('No callback set on finish')
DECLARE SUB noopen ()
DECLARE SUB showfiles ()
DECLARE SUB printmatrix ()
DECLARE SUB exporttotext ()
DECLARE SUB openfromfile ()
DECLARE SUB savetofile ()
DECLARE SUB background ()
DECLARE SUB CLEARBOTTOM ()
DECLARE SUB menu ()
DECLARE SUB centertext (inputtext$)
@tylerlwsmith
tylerlwsmith / .env
Last active August 7, 2021 21:02
Jenkins Docker Compose
JENKINS_UID=1000
JENKINS_GID=1000
type SharedProps = {
multiple: boolean;
name: string;
}
type Multiple = SharedProps & {
multiple: true;
callback: (items: string[]) => void;
}