Skip to content

Instantly share code, notes, and snippets.

/*
* Get the auth token from local option
*
* @access public
* @return NULL
*/
public function get_local_auth_token() {
// get the token from the options table
$this->auth_token = get_option( 'bigcommerce_auth_token' );
@topher1kenobe
topher1kenobe / get_remote_auth_token.php
Last active August 31, 2020 19:13
Class method that gets an authenitcation token from BigCommerce
/*
* Get the auth token from BigCommerce
*
* @access public
* @return string $token
*/
public function get_remote_auth_token() {
// Set up the REST authentication headers
$headers[ 'X-Auth-Token' ] = $this->access_token;
@topher1kenobe
topher1kenobe / podcast_link_buttons.php
Created December 5, 2021 21:11
Podcast Buttons file for wppodcasts.com
@topher1kenobe
topher1kenobe / gist:73053b393cad123510e1bbbecf1b4457
Created October 11, 2022 20:20
take a screenshot, ssh it someplace
#!/bin/bash
/opt/homebrew/bin/ffmpeg -ss 0.5 -f avfoundation -r 30.000030 -i "0" -t 1 /Users/topher/window_shots/"grmi_$(date +%F_%H-%M-%S).jpg" -frames:v 1
unset -v latest
for file in /Users/topher/window_shots/*; do
[[ $file -nt $latest ]] && latest=$file
done
keychain --noask --eval id_dsa
// change slug on post if title is changed.
add_action( 'save_post', 'icput_post_title_fix' );
function icput_post_title_fix( $post_id ) {
$url = rwmb_get_value( 'canonical_url', '', $post_id );
if ( empty( $url ) ) {
return;
}