Skip to content

Instantly share code, notes, and snippets.

Avatar

Jamie Hamel‑Smith jamiehs

View GitHub Profile
@jamiehs
jamiehs / functions.php
Created Mar 3, 2014
Allows WordPress' importer to import media assets from one localhost site to another www.site1.dev to www.site2.dev (localhost sites). It seems that the WordPress wp_http_validate_url() function disallows the opening of URLs from the same host (127.0.0.1)
View functions.php
<?php
add_filter( 'http_request_host_is_external', 'explicitly_allow_same_host_requests_for_import' );
function explicitly_allow_same_host_requests_for_import(){
return true;
}
@jamiehs
jamiehs / recursive-download.sh
Created Feb 26, 2014
Recursively download a directory listing structure, filtering specific file types.
View recursive-download.sh
wget -r -A=jpeg,jpg,bmp,png,gif,tiff,xpm,ico http://www.somesite.com/
View Contract Killer 3.md

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@jamiehs
jamiehs / 01-modal_content.html
Last active Aug 29, 2015
Assuming the below HTML with the video class on the modal and the video URL as the data attribute on the video content.
View 01-modal_content.html
<a data-toggle="modal" data-target=".bs-modal-lg">Open Modal</a>
<div class="modal fade bs-modal-lg video" tabindex="-1" role="dialog" aria-labelledby="VideoModal" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content" data-video-url="//player.vimeo.com/video/84747519?portrait=0&amp;byline=0&amp;title=0&amp;autoplay=1">
<div class="fve-video-wrapper fve-image-embed fve-thumbnail-image youtube" style="padding-bottom:56.25%;">
<iframe src="" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
</div>
</div>
@jamiehs
jamiehs / style.css
Created Dec 19, 2013
Trying to figure out how to scale the fonts globally on a dashboard at work, and I stumbled upon this great tip! http://superuser.com/a/635447/283081
View style.css
/* Using this, a web page designed for a 720p screen can be simply scaled up to 1080p (or vice-versa) */
/* This works especially well when the graphics are SVG and or icon fonts */
body { zoom: 1.5;} /* 1280 * 1.5 = 1920
@jamiehs
jamiehs / gist:7982801
Created Dec 16, 2013
Undocumented YouTube thumbnail size. It seems to include some sort of signature.
View gist:7982801
http://i4.ytimg.com/vi/ZwUa-olnPV0/sddefault.jpg?w=640&h=360&feature=em-upload_owner&sigh=3SP2iJ7rMvM9pVfZGbrD-ubbk6w
@jamiehs
jamiehs / content.html
Created Nov 25, 2013
Fluid Video Embeds. Includes modest branding and other niceties in the embed URL.
View content.html
<div class="fve-video-wrapper">
<iframe width="100%" height="100%" src="https://www.youtube.com/embed/kCIRQuHdBgQ?wmode=transparent&amp;modestbranding=1&amp;autohide=1&amp;showinfo=0&amp;rel=0" frameborder="0" allowfullscreen></iframe>
</div>
@jamiehs
jamiehs / svg.html
Created Nov 15, 2013
SVG/PNG Fallback for IE 8 and lower.
View svg.html
<!--[if lte IE 8]> <img src="../octopus.png"> <![endif]-->
<!--[if gt IE 8]><!--> <img src="../octopus.svg"> <!--<![endif]-->
View gist:7437652
[color]
ui = true
[alias]
st = status
c = commit -m
a = add
aa= !git add -u && git add . && git status
co = checkout
cob = checkout -b
up = !git fetch origin && git rebase origin/master
@jamiehs
jamiehs / gist:7415442
Created Nov 11, 2013
Find MySQL Log Location
View gist:7415442
$(ps auxww|sed -n '/sed -n/d;/mysqld /{s/.* \([^ ]*mysqld\) .*/\1/;p;}') --verbose --help|grep '^log'
You can’t perform that action at this time.