Skip to content

Instantly share code, notes, and snippets.

View westonruter's full-sized avatar

Weston Ruter westonruter

View GitHub Profile
@simonw
simonw / install-lxml-osx-static-deps
Created August 14, 2009 11:43
A working recipe for installing lxml on OS X with static dependencies and no need for MacPorts or Fink
cd /tmp
wget http://codespeak.net/lxml/lxml-2.2.2.tgz
tar -xzvf lxml-2.2.2.tgz
cd lxml-2.2.2
cd libs/
wget ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gz
wget ftp://xmlsoft.org/libxml2/libxslt-1.1.24.tar.gz
cd ..
python setup.py build --static-deps --libxml2-version=2.7.3 --libxslt-version=1.1.24
sudo python setup.py install
@paulirish
paulirish / gist:526168
Created August 16, 2010 00:42 — forked from anonymous/>
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- According to Heather Champ, former community manager at flickr,
you should not allow search engines to index your "Contact Us"
@jeremyfelt
jeremyfelt / hide-inactive-jetpack-modules.php
Last active December 26, 2015 00:19
Hide inactive Jetpack modules
<?php
/*
Plugin Name: Hide Inactive Jetpack Modules
Plugin URI: https://gist.github.com/jeremyfelt/7062883
Description: Hides Jetpack modules that are marked as inactive, providing for a shorter list.
Version: 0.1
Author: Jeremy Felt
Author URI: http://jeremyfelt.com
License: GPL2
*/
@tomjn
tomjn / gist:6140601
Last active December 20, 2015 13:39
If you're lucky enough to be using any version of PHP 5 with WordPress ( 100% chance! ) You can do this:
<?php
$posts = new posts_loop();
foreach( $posts as $id => $post ) {
the_title();
// etc...
}
// put this below in your functions.php:
@tomjn
tomjn / gist:6140172
Last active December 20, 2015 13:39
If you're lucky enought o be running WordPress on PHP 5.5, you can use generators for your post loops like this
<?php
// with the above we can now do things like this:
foreach ( posts_loop() as $p ) {
get_template_part( 'content', 'page' );
comments_template( '', true );
}
// put this below in your functions.php:
#!/bin/bash
# Run php files in the repo through phpcs, opting for a subset of only checking staged or modified files
# By @westonruter
status_filter='^.M'
status_filter_description="Linting modified files only"
while getopts ":sa" opt; do
case $opt in
s)
@xentek
xentek / wp-unit-tests.md
Created August 26, 2012 19:06
WordPress Unit Tests Quick Start

WordPress Unit Tests Quick Start Guide

This quick start guide is geared towards installing PHPUnit on OSX in order to run the WordPress unit tests. It uses homebrew to install PHP using homebrew-php. You can likely skip this step if you've already got php and pear installed properly.

If you use MAMP, then try these instructions to use MAMP's php and pear to install PHPUnit.

install homebrew

ruby &lt;(curl -fsSkL raw.github.com/mxcl/homebrew/go)
@joshwnj
joshwnj / files-from-month.sh
Created May 21, 2012 22:17
give me a list of files from the month of May 2011
## give me a list of files from the month of May 2011
ls -laht --color=never | egrep 'May[ ]+[0-9]+[ ]+2011(.*)' | sed 's/.*2011 / /'
## move them to a separate directory
mkdir may-2011; ls -laht --color=never | egrep 'May[ ]+[0-9]+[ ]+2011(.*)' | sed 's/.*2011 / /' | xargs -I {} mv {} may-2011/
@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);
@johndyer
johndyer / .htaccess
Created July 13, 2011 13:06
Google+ redirect .htaccess
#simple version (http://mysite.com/+ goes to your Google+ account)
Redirect /+ https://plus.google.com/[yourid]
Redirect /@ https://twitter.com/[twitterusername]
#powerhouse (http://mysite.com/+/about goes to your Google+ about page)
RedirectMatch ^/\+(.*)$ http://plus.google.com/[yourid]$1
RedirectMatch ^/@(.*)$ http://twitter.com/[twitterusername]$1