Skip to content

Instantly share code, notes, and snippets.

View brewconfig.txt
brew --config
/usr/bin/gcc
HOMEBREW_VERSION: 0.8
HEAD: 1e472655c6b764c79f1056c956c6da2453214aba
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: dual-core 64-bit penryn
OS X: 10.7
View brewdoctor.txt
/usr/bin/gcc
Your gcc 4.2.x version is older than the recommended version. It may be advisable
to upgrade to the latest release of Xcode.
We couldn't detect any version of Xcode.
If you downloaded Xcode 4.1 from the App Store, you may need to run the installer.
View vimrc
" Tabs and Spaces
set tabstop=2
set shiftwidth=2
set softtabstop=2
set backspace=indent,eol,start
set expandtab
set autoindent
set smartindent
set smarttab
@swalkinshaw
swalkinshaw / gist:2695510
Created May 14, 2012
WordPress: Mandatory Excerpt
View gist:2695510
<?
function mandatory_excerpt($data) {
$excerpt = $data['post_excerpt'];
if (empty($excerpt)) {
if ($data['post_status'] === 'publish') {
add_filter('redirect_post_location', 'excerpt_error_message_redirect', '99');
}
@swalkinshaw
swalkinshaw / _mixin_2ximages.scss
Created Jan 8, 2013 — forked from replete/_mixin_2ximages.scss
SASS mixin for retina background images. Requires Compass for the image-width and image-height functions.
View _mixin_2ximages.scss
@mixin image-2x($image1, $image2) {
background-image: url($image1);
@media (min--moz-device-pixel-ratio: 1.3),
(-o-min-device-pixel-ratio: 2.6/2),
(-webkit-min-device-pixel-ratio: 1.3),
(min-device-pixel-ratio: 1.3),
(min-resolution: 1.3dppx) {
background-image: url($image2);
background-size: image-width($image1) image-height($image1);
}
View image_optimizer.php
<?php
/*
Plugin Name: Image Optimizer
Plugin URI:
Description: Automatically optimizes images using jpegtran and optipng on upload
Version: 0.1
Author: Scott Walkinshaw
Author URI:
Support URI:
*/
@swalkinshaw
swalkinshaw / Gruntfile.coffee
Created Jul 8, 2013
Grunt connect-livereload with pushState rewrites
View Gruntfile.coffee
'use strict'
path = require 'path'
parse = require('url').parse;
module.exports = (grunt) ->
grunt.initConfig
qunit:
all: ['tests/**/*.html']
clean:
@swalkinshaw
swalkinshaw / wp.log
Last active Dec 20, 2015
WP Logger output
View wp.log
[2013-08-09 19:40:52] WP.INFO: Started GET /download/ for 192.168.50.1 at 2013-08-09 19:40:52 [] []
[2013-08-09 19:40:52] WP.INFO: SQL Query: SELECT option_value FROM wp_options WHERE option_name = 'stylesheet_root' LIMIT 1 [] []
[2013-08-09 19:40:52] WP.INFO: SQL Query: SELECT * FROM wp_users WHERE user_login = 'admin' [] []
[2013-08-09 19:40:52] WP.INFO: SQL Query: SELECT user_id, meta_key, meta_value FROM wp_usermeta WHERE user_id IN (1) [] []
[2013-08-09 19:40:52] WP.INFO: SQL Query: SELECT option_value FROM wp_options WHERE option_name = 'widget_pages' LIMIT 1 [] []
[2013-08-09 19:40:52] WP.INFO: SQL Query: SELECT option_value FROM wp_options WHERE option_name = 'widget_calendar' LIMIT 1 [] []
[2013-08-09 19:40:52] WP.INFO: SQL Query: SELECT option_value FROM wp_options WHERE option_name = 'widget_tag_cloud' LIMIT 1 [] []
[2013-08-09 19:40:52] WP.INFO: SQL Query: SELECT option_value FROM wp_options WHERE option_name = 'widget_nav_menu' LIMIT 1 [] []
[2013-08-09 19:40:52] WP.INFO: SQL Quer
View wp-setup.php
<?php
if (!is_blog_installed()) { return; }
if ('http://' . $_SERVER['SERVER_NAME'] . '/wp' == get_option('home')) {
update_option('siteurl', 'http://' . $_SERVER['SERVER_NAME'] . '/wp');
update_option('home', 'http://' . $_SERVER['SERVER_NAME']);
update_option('upload_path', $_SERVER['DOCUMENT_ROOT'] . '/media');
update_option('upload_url_path', 'http://' . $_SERVER['SERVER_NAME'] . '/media');
update_option('permalink_structure', '/%postname%/');
}
View Capfile
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Custom tasks
require 'capistrano/composer'
require 'capistrano/npm'