Skip to content

Instantly share code, notes, and snippets.

View vidluther's full-sized avatar

Vid Luther vidluther

View GitHub Profile
#!/bin/bash
knife search node "*:*" -a ec2.public_ipv4 | awk -f knife-output.awk
HTML5 U.S. Zip Code/Canadian Postal code Validation
<input class="lead-zip full-wide" title="U.S. or Canadian Zip or Postal code is required" pattern="(\d{5}([\-]\d{4})?)|[A-Za-z][0-9][A-Za-z] [0-9][A-Za-z][0-9]" type="text" name="lead-zip" placeholder="Zip Code *" required />
@mjangda
mjangda / s-maintenance-mode.php
Created August 16, 2012 14:28
Custom WordPress maintenance mode that allows super admins access to the Dashboard
<?php
add_action( 'init', 'x_maintenance_mode' );
function x_maintenance_mode() {
if ( defined( 'X_MAINTENANCE_MODE' ) && true === X_MAINTENANCE_MODE ) {
if ( is_super_admin() && is_admin() )
return;
die( 'Site is currently under maintenance' );
@JPry
JPry / remove-wpe-info.php
Last active January 19, 2022 20:52
Remove WP Engine info from WP Dashboard
<?php
// Remove all evidence of WP Engine from the Dashboard, unless the logged in user is "wpengine"
$user = wp_get_current_user();
if ( $user->user_login != 'wpengine' ) {
add_action( 'admin_init', 'jpry_remove_menu_pages' );
add_action( 'admin_bar_menu', 'jpry_remove_admin_bar_links', 999 );
}
/**
@warmwaffles
warmwaffles / error_page.py
Created February 16, 2012 18:19
Add / Remove Rackpsace Loadbalancer Error Page
#!/usr/bin/python
#
# Just change the three variables below and you are all set!
# @author Matthew A. Johnston (WarmWaffles)
# your user name
API_USERNAME = "username"
# your api key
API_KEY = "api-key"
# Load balancer Region
@grahamc
grahamc / call.php
Created December 6, 2011 15:45
Robocall a whole bunch of people from PayPal about this Regretsy disaster.
<?php
// Note: CA state law says no robocalls before 9AM, so wait until 12PM EST.
$sid = 'Your SID';
$token = 'Your Token';
$telephoneNumber = 'Your Telephone Number, the one that Twilio gives you.';
$client = new Services_Twilio($sid, $token);
@bkimble
bkimble / gist:1365005
Last active August 22, 2024 14:21
List local memcached keys using Ruby
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key)
rows = []
@jperras
jperras / .gitconfig
Created July 31, 2010 18:03
.gitconfig
[color]
diff = auto
status = auto
branch = auto
[color "branch"]
current = yellow reverse
local = yellow
[color "diff"]
meta = yellow
frag = magenta bold