Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am desmillicious on github.
  • I am jdmiller (https://keybase.io/jdmiller) on keybase.
  • I have a public key whose fingerprint is C3F7 CDC9 281D 962F DCD9 B6F4 9A23 8A0B 05E6 22B6

To claim this, I am signing this object:

Verifying that +jonathonmiller is my blockchain ID. https://onename.com/jonathonmiller
@desmillicious
desmillicious / add_http.php
Created October 9, 2014 06:44
Add HTTP protocol to a link
<?php
// Add an http to a link that doesn't have one
function addhttp($url) {
if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
$url = "http://" . $url;
}
return $url;
}
@desmillicious
desmillicious / wp_responsive_images_sizes.php
Created October 9, 2014 06:39
Wordpress Responsive Images Sizes Function
<?php
// Responsive Image Sizes Function for Wordpress
// Returns smaller size names based on Mobile device type
// Requires Mobble Plugin installed http://wordpress.org/plugins/mobble/
// Remove unwanted standard image sizes if necessary
function sgr_filter_image_sizes( $sizes) {
// unset( $sizes['thumbnail']); good idea to keep thumbnail as it's used by wp
// unset( $sizes['medium']); good idea to keep medium as it's used by wp buy make it small in the wp-admin and don't use it on the front end
unset( $sizes['large']);