Skip to content

Instantly share code, notes, and snippets.

@paulnett
paulnett / index.html
Created January 6, 2013 23:08 — forked from mfkp/index.html
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="jquery.ketchup.all.min.js" type="text/javascript"></script>
</head>
<body>
<div id="email">
<span>Enter your email to sign up</span>
<form action="/subscribe.php" id="invite" method="POST">
@paulnett
paulnett / blackandwhiteimages.php
Created May 17, 2012 07:31
Generate B + W images in WordPress
<?php
add_image_size('thumbnail-bw', 400, 0, false);
add_filter('wp_generate_attachment_metadata','bw_images_filter');
function bw_images_filter($meta) {
$file = wp_upload_dir();
$file = trailingslashit($file['path']).$meta['sizes']['thumbnail-bw']['file'];
list($orig_w, $orig_h, $orig_type) = @getimagesize($file);
$image = wp_load_image($file);
imagefilter($image, IMG_FILTER_GRAYSCALE);
@paulnett
paulnett / jquery.ba-seq.js
Created May 7, 2012 23:26 — forked from cowboy/jquery.ba-seq.js
jQuery seq: execute code sequentially, for each selected element.
/*!
* jQuery seq - v0.1 - 03/1/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($){