Skip to content

Instantly share code, notes, and snippets.

View wpsmithtwc's full-sized avatar

Travis Smith wpsmithtwc

View GitHub Profile
@snshn
snshn / wp-plugin-scan.js
Created December 23, 2016 02:16
Scan wordpress website for installed plugins from within js console
/* wp-plugin-scan.js */
/* Scan your wordpress website for plugins from within your browser's JS console */
/* Released into public domain */
/* Usage: */
/* 1. Go to target website */
/* 2. Make sure that JS for that tab/host is enabled (e.g. temporarily disable AdBlock) */
/* 3. Fire up the development JS console */
/* 4. Copy, paste, and execute this script within the browser's console */
@davebarnwell
davebarnwell / PHP composer tools.md
Last active February 3, 2025 21:58
Global installation of PHP tools with Composer

Global installation of PHP tools with Composer

To install a composer package globally, you run the usual require command, but with the addition of the global modifier. So to install PHPUnit, you would run:

$ composer global require phpunit/phpunit
$ composer global require phpunit/dbunit
$ composer global require phing/phing
$ composer global require phpdocumentor/phpdocumentor
$ composer global require sebastian/phpcpd
@homam
homam / index.html
Created September 16, 2016 14:31
service workers offline page
<!doctype html>
<html lang=en-GB>
<head>
<meta charset='utf-8'>
<title>The Air Horner</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
</head>
<body>
<iframe style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; width:100%; height: 100%"
src="http://tv-app-web-map.herokuapp.com/"
@edheltzel
edheltzel / config.yml
Last active June 2, 2021 21:41
This is my VERY opinionated install script for WordPress - you'll need to have wp-cli installed for this to work - I have this wrapped as an ZSH function inside of my dotfiles setup but you can easily convert to a bash script.
# -------------------------------------------------------------------
# This file live inside of your ~/.wp-cli
# -------------------------------------------------------------------
# path: cms # this is the path to your WordPress files
core install:
admin_user: <YOUR ADMIN USERNAME>
admin_password: <YOUR ADMIN PASSWORD>
admin_email: <YOUR ADMIN EMAIL>
title: The Next Big Deal in WordPress Sites
@montanaflynn
montanaflynn / poker.go
Last active June 2, 2024 03:17
Generate a deck of cards, shuffle it and then deal them out in Golang
package main
import (
"fmt"
"math/rand"
"os"
"time"
)
// Card holds the card suits and types in the deck
@d4l3k
d4l3k / about.md
Last active February 16, 2023 10:56
Golang Performance Tricks

This is a gist with a set of helpful performance tricks and best practices that I've found on the internet.

@harlow
harlow / golang_job_queue.md
Last active March 29, 2025 04:55
Job queues in Golang
@oneohthree
oneohthree / quick-slugify.sh
Last active April 10, 2025 08:25
Quick bash slugify
echo "$STRING" | iconv -t ascii//TRANSLIT | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z
@ccurtin
ccurtin / Custom Social Sharing Buttons for Wordpress Shortcode.php
Last active May 8, 2023 19:31
Custom Social Sharing Buttons for Wordpress
<?php
/*
http://stackoverflow.com/questions/12448134/social-share-links-with-custom-icons
http://petragregorova.com/articles/social-share-buttons-with-custom-icons
wp_enqueue_style('fontAwesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css', array(), '4.3.0', 'all');
use in template files:: <?php echo do_shortcode('[social_sharing]') ; ?>
*/
@badfeather
badfeather / sunrise.php
Last active June 8, 2021 18:58
Allow nested folder paths in WordPress Multisite with subdirectories
<?php
/**
* Allow nested folder paths in WordPress Multisite with subdirectories
* Updated from http://maisonbisson.com/post/14052/wordpress-hacks-nested-paths-for-wpmu-blogs/ to account for latest WordPress code
* .htaccess rules also need to be changed to:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]