Skip to content

Instantly share code, notes, and snippets.

View helen's full-sized avatar
🥇
#first-name-club

Helen Hou-Sandi helen

🥇
#first-name-club
View GitHub Profile
@rmccue
rmccue / gist:ec6a7d79349ea7e9b206
Last active March 28, 2017 21:22
WordPress test server - front controller for testing WP. *****NEVER USE THIS ON PRODUCTION******
<?php
/**
* WordPress Test Server
*
* This serves up a full WordPress site via the PHP test server (`php -S`), and
* is intended purely for serving WP for UI testing. Please do not ever use this
* in production.
*/
// Path to WP install
@kurtpayne
kurtpayne / rarst.php
Created December 3, 2013 15:00
Super subtle troll
<?php
/**
* Plugin Name: Rarst's favorite plugin
* Description: SHUT UP
* Version: INF
* Author: The unholy army of trolls
* License: GPLv2 or MIT (they're equivalent, right?)
*/
add_action( 'all', function() {
global $wp_filter;
@markjaquith
markjaquith / gist:6225805
Last active February 21, 2024 23:56
WordPress multi-tenant directory structure sharing core files for opcode awesomeness, fast deployments, and low disk usage. With inspiration from @weskoop. "=>" indicates a symlink.
sites
|__ ms.dev
| |__ content
| |__ index.php
| |__ wp => ../../wordpress/stable
| |__ wp-config.php
|__ one.dev
| |__ content
| |__ index.php
| |__ wp => ../../wordpress/stable
@jeremyfelt
jeremyfelt / proxy-production.conf
Last active May 14, 2019 18:02
Nginx configuration to proxy 404 files locally to a production domain
# Adjust this to include any other necessary files.
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 24h;
log_not_found off;
try_files $uri $uri/ @production;
}
location @production {
resolver 1.1.1.1;
proxy_pass http://{replace-with.domain.com}/$uri;
@thomasgriffin
thomasgriffin / gist:4953041
Created February 14, 2013 14:04
My gift to you this Valentine's Day. Rendering custom attachment fields in the new media manager via Backbone.
/**
* The code below renders additional custom attachment fields into the
* new media manager.
*
* I am assuming you are using your own custom media modal frame. By
* extending the default Attachment.Details subview, we can append our
* custom fields to the default fields listed.
*
* In the initialize function, we ensure that our changes are always up
* to date by "listening" to our model's change event and updating the
@tommcfarlin
tommcfarlin / meta-data-serialization.php
Last active November 4, 2022 00:28
An example function used to demonstrate how meta data is typically saved in a WordPress theme or plugin. The gist is made public so that developers can contribute to the standard security boilerplate functionality in order to simplify, reduce, and improve our serialization functions.
<?php
/**
* An example function used to demonstrate how to use the `user_can_save` function
* that provides boilerplate security checks when saving custom post meta data.
*
* The ultimate goal is provide a simple helper function to be used in themes and
* plugins without the need to use a set of complex conditionals and constants.
*
* Instead, the aim is to have a simplified function that's easy to read and that uses
* WordPress APIs.
@koop
koop / gallery.js
Created December 3, 2012 01:46
Query all attachments uploaded to a post.
@helen
helen / .bashrc
Last active January 26, 2024 19:49
My ~/.bashrc
green=$(tput setaf 2)
yellow=$(tput setaf 3)
magenta=$(tput setaf 5)
reset=$(tput sgr0)
# This was not working with \w, which has since been changed to \W in favor of window title showing $PWD
# PROMPT_DIRTRIM=3
export EDITOR='code --wait';
export SVN_EDITOR='code --wait';
@markjaquith
markjaquith / plugin-deploy.sh
Created November 16, 2012 05:04 — forked from scribu/plugin-deploy.sh
Plugin deploy script
#!/bin/bash
# args
MSG=${1-'deploy from git'}
BRANCH=${2-'trunk'}
# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
DEST_DIR=~/svn/wp-plugins/$DIR_NAME/$BRANCH
@nacin
nacin / Modific.sublime-settings.js
Created September 25, 2012 06:52
My config for Modific. Disables --internal-diff (didn't work on Mac OSX 10.8 with svn 1.6.18 client). Reprograms a few key bindings I'll actually use.
// Modific default settings
{
// Name of a region icon
// Valid icon names are dot, circle, bookmark and cross
"region_icon": "circle",
// You can use your commands instead of plain "git" or "svn"
// e.g. "/usr/bin/git" or "C:\bin\git.exe"
"vcs": [
["svn", "/usr/bin/svn"],