Skip to content

Instantly share code, notes, and snippets.

@mikejolley
mikejolley / gist:1604009
Created January 13, 2012 00:31
WooCommerce - Add a special field to the checkout, order emails and user/order meta
/**
* Add the field to the checkout
**/
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>';
/**
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@textandhypertext
textandhypertext / _font-face.sass
Created March 2, 2012 12:48
Sass mixin for @font-face with styles and weights
=font-face($family, $style, $weight)
$prefix = "'type/" +$family + $style + $weight
@font-face
font:
family: $family
style: $style
weight: $weight
src: url($prefix + ".eot?#iefix'") format('embedded-opentype')
src: url($prefix + ".woff'" ) format('woff')
src: url($prefix + ".ttf'") format('truetype')
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 7, 2024 07:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@statico
statico / gist:3172711
Created July 24, 2012 21:15
How to use a PS3 controller on Mac OS X 10.7 (Lion)

How to use a PS3 controller on Mac OS X 10.7 (Lion)

  1. Open Apple menu -> System Preferences -> Bluetooth and disable Bluetooth on Mac as well as any other nearby Macs or devices which will try to pair with and confuse the controller.

  2. Reset PS3 controller by inserting paperclip into pinhole near L2 button.

  3. Connect PS3 controller to Mac with USB cable.

  4. Enable Bluetooth.

@BjornW
BjornW / noise.sh
Last active February 3, 2024 06:02 — forked from rsvp/noise.sh
noise : relaxing ambient Brown noise generator (cf. white noise) | Linux bash script using sox | CogSci notes
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-10-04
#
# _______________| noise : ambient Brown noise generator (cf. white noise).
#
# Usage: noise [minutes=59] [band-pass freq center=1786] [wave]
# ^minutes can be any positive integer.
# Command "noise 1" will display peak-level meter.
#
# Dependencies: play (from sox package)
@michael-martin
michael-martin / WordPress-Tweet-List.php
Last active September 24, 2020 03:29
Display tweets in WordPress using Twitter API v1.1 - With authentication and a fallback when Twitter is down. Full explanation here: http://www.problogdesign.com/wordpress/authenticate-your-twitter-api-calls-before-march/
<?php
/* REQUIRES: TwitterOAuth
* https://github.com/abraham/twitteroauth/tree/master/twitteroauth
*
* Download and place in a /twitteroauth/ folder in your theme/plugin.
*
*
* Full guide here: http://www.problogdesign.com/wordpress/authenticate-your-twitter-api-calls-before-march/
*
* Uses:
@valpackett
valpackett / Alfred-Pinboard-INSTANT.md
Last active September 7, 2023 21:01
INSTANT Pinboard search from Alfred 2

INSTANT Pinboard search from Alfred 2

I've had a Python script that makes an HTML Bookmarks file for LaunchBar.
Now that I use Alfred 2, I modified it to make XML for Alfred.
This allows me to search my bookmarks with GREP SPEED!

Installation

First, add your token (from pinboard.in/settings/password) to ~/.netrc

@a1phanumeric
a1phanumeric / gist:5346170
Created April 9, 2013 14:35
Grep exclusions. Demonstrates how to exclude multiple directories, and files.
grep -r --color --exclude-dir={custom,lib,scripts} --exclude={*.xml,error_log} "beta" .