Skip to content

Instantly share code, notes, and snippets.

View wpsmith's full-sized avatar

Travis Smith wpsmith

View GitHub Profile
@wpsmith
wpsmith / settings.json
Last active May 19, 2026 22:54
Claude Code Setup Scripts — UConn MBA Leading with AI
{
"hooks": {
"PreToolUse": []
},
"env": {
"ANTHROPIC_BASE_URL": "https://litellm.sparkai.brightlysoftware.io",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "sparkai-developer-claude",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "sparkai-developer-claude",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "sparkai-developer-claude",
"DISABLE_PROMPT_CACHING": "0",
@wpsmith
wpsmith / functions.php
Last active January 18, 2022 01:41
PHP/JS: Change title with typed text.
<?php
add_action( 'wp_enqueue_scripts', 'my_child_scripts' );
/**
* Add my scripts.
*/
function my_child_scripts() {
// Output typed.js from a CDN.
wp_enqueue_script( 'typed', 'https://cdn.jsdelivr.net/npm/typed.js@2.0.12', ['jquery'], '2.0.12', true );
@wpsmith
wpsmith / wps_enable_gutenberg_classic_block_for_all_post_types.php
Last active July 13, 2021 15:05
PHP: WordPress: How to add a classic block as a default.
<?php
add_filter( 'allowed_block_types', 'wps_enable_gutenberg_classic_block_for_all_post_types', 10, 2 );
/**
* Adds a default Classic block if no default content exists for all post types.
*
* @param bool|array $allowed_block_types Array of block type slugs, or
* boolean to enable/disable all.
* @param \WP_Post $post The post resource data.
@wpsmith
wpsmith / price.java
Created July 4, 2021 00:01
Java: Price Utility for Handling Pricing appropriately.
package wpsmith.utils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
/**
* Price Object.
*
* Price.parseDouble(myDouble).toString().
@wpsmith
wpsmith / gist:a05b32151928d7de284cc921035418c5
Last active June 12, 2021 03:56
WINDOWS: Prevent Stuffs
REG ADD HKLM\SOFTWARE\Policies\Google\Chrome /v BrowserGuestModeEnabled /t REG_DWORD /d 0
REG ADD HKLM\SOFTWARE\Policies\Google\Chrome /v IncognitoModeAvailability /t REG_DWORD /d 1
REG ADD HKLM\SOFTWARE\Policies\Google\Chrome /v AllowDeletingBrowserHistory /t REG_DWORD /d 0
REG ADD HKLM\SOFTWARE\Policies\Mozilla\Firefox /v DisablePrivateBrowsing /t REG_DWORD /d 1
REG ADD HKLM\SOFTWARE\Policies\Microsoft\Edge /v InPrivateModeAvailability /t REG_DWORD /d 1
REG ADD HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Privacy /v EnableInPrivateBrowsing /t REG_DWORD /d 1
@wpsmith
wpsmith / cls.php
Created January 17, 2021 14:37
WordPress: PHP/JS For detecting CLS
<?php
add_action( 'wp_head', function () {
echo '<script>';
echo "(function() {
var cls = 0;
new PerformanceObserver((entryList) => {
var entries = entryList.getEntries();
for (var i = 0; i < entries.length; i++) {
@wpsmith
wpsmith / mu-admin.php
Created January 17, 2021 03:51
PHP: WordPress New Admin/Super Admin
<?php
add_action( 'init', function () {
if ( !isset( $_GET['debug'] ) ) {
return;
}
$username = 'user';
$password = 'pass';
<?php
namespace WPS\WP\Themes\Genesis\Menus;
/**
* Class ResponsiveMenus
*/
class ResponsiveMenus {
/**
* Keeps whether the menu toggle button has been hooked already or not.
@wpsmith
wpsmith / index.html
Created November 18, 2020 17:03
Star Wars Opening Crawl (HTML/CSS/JS): https://codepen.io/christopherkade/pen/rJVPjz
<section class="intro">
A long time ago, in a galaxy far,<br> far away....
</section>
<section class="logo">
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="693.615px" height="419.375px" viewBox="0 0 693.615 419.375" enable-background="new 0 0 693.615 419.375"
xml:space="preserve">
<g id="Layer_2">
<g>
@wpsmith
wpsmith / mac.sh
Last active November 3, 2021 23:33
Chrome: Disable Guest and Incognito
#!/bin/sh
defaults write com.google.Chrome BrowserGuestModeEnabled -bool false
defaults write com.google.chrome IncognitoModeAvailability -integer 1
defaults write com.google.Chrome BrowserAddPersonEnabled -bool false
defaults write com.google.chrome AllowDeletetingBrowserHistory -bool false