Skip to content

Instantly share code, notes, and snippets.

View netaustin's full-sized avatar

Austin Smith netaustin

View GitHub Profile
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
}
location ^~ /wp-login.php {
deny all;
}
location ~ \.php$ {
<?php
// using Fieldmanager for a slideshow - any number of slides, with any number of related links
add_action( 'init', function() {
$fm = new Fieldmanager_Group( array(
'name' => 'slideshow',
'limit' => 0,
'label' => 'New Slide',
'label_macro' => array( 'Slide: %s', 'title' ),
'add_more_label' => 'Add another slide',
'collapsed' => True,
<?php
// put this in functions.php or an include file
add_action( 'init', function() {
$fm = new Fieldmanager_Group( array(
'name' => 'contact_information',
'children' => array(
'name' => new Fieldmanager_Textfield( 'Name' ),
'phone_number' => new Fieldmanager_Textfield( 'Phone Number' ),
'website' => new Fieldmanager_Link( 'Website' ),
),
@netaustin
netaustin / nginx.conf
Created January 11, 2013 16:32
This is an nginx config file for local development which automatically directs *.dev to ~/www/*
worker_processes 2;
error_log logs/error.log;
events {
worker_connections 1024;
}
@netaustin
netaustin / add-empty-dirs.sh
Created August 2, 2012 13:44
Bash Script to add .svn/tmp directories to Git
basedir=$1
for dir in $(find . -name "$basedir" -type d); do
touch "$dir/.gitignore";
git add "$dir";
done
@netaustin
netaustin / fabric.py
Created May 21, 2012 03:47
Fabric SSH Tunnel
from fabric.api import *
from fabric.contrib.console import confirm
from local_settings import remote_user
from time import time
import subprocess, shlex, atexit, time
from settings import DATABASES
from os import remove
env.use_ssh_config = True
env.context = 'local'
.node-unpublished{background-color:#fff4f4;}.preview .node{background-color:#ffffea;}#node-admin-filter ul{list-style-type:none;padding:0;margin:0;width:100%;}#node-admin-buttons{float:left;
margin-left:0.5em;
clear:right;}td.revision-current{background:#ffc;}.node-form .form-text{display:block;width:95%;}.node-form .container-inline .form-text{display:inline;width:auto;}.node-form .standard{clear:both;}.node-form textarea{display:block;width:95%;}.node-form .attachments fieldset{float:none;display:block;}.terms-inline{display:inline;}
fieldset{margin-bottom:1em;padding:.5em;}form{margin:0;padding:0;}hr{height:1px;border:1px solid gray;}img{border:0;}table{border-collapse:collapse;}th{text-align:left;
padding-right:1em;
border-bottom:3px solid #ccc;}