Skip to content

Instantly share code, notes, and snippets.

View lewismcarey's full-sized avatar

Lewis Carey lewismcarey

  • ThirtyThree
  • London, UK
View GitHub Profile
@lewismcarey
lewismcarey / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// ----
// Sass (v3.2.14)
// Compass (v0.12.2)
// ----
/*!
Video.js Default Styles (http://videojs.com)
Version GENERATED_AT_BUILD
Create your own skin at http://designer.videojs.com
*/
@lewismcarey
lewismcarey / blackandwhiteimages.php
Created April 12, 2012 16:40
Generate B + W images in WordPress
<?php
/* using thumbnail */
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']['file'];
list($orig_w, $orig_h, $orig_type) = @getimagesize($file);
$image = wp_load_image($file);
imagefilter($image, IMG_FILTER_GRAYSCALE);