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
@PeteMall
PeteMall / svn-rev.php
Created September 9, 2011 16:49
Show the svn revision in admin footer.
<?php
function pm_svn_revision( $msg = '' ) {
if ( $svn = File( '.svn/entries' ) )
$msg .= ' SVN Revision: ' . $svn[3];
return $msg;
}
add_action( 'update_footer', 'pm_svn_revision', 99 );
?>
@koop
koop / gallery.js
Created December 3, 2012 01:46
Query all attachments uploaded to a post.
@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
@markjaquith
markjaquith / .all
Last active October 10, 2018 15:38
Bash stuff
for f in ~/Dropbox/bash/*; do source $f; done
@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.
@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 / 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
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#