Skip to content

Instantly share code, notes, and snippets.

View jruck's full-sized avatar

Justin Ruckman jruck

View GitHub Profile
@jruck
jruck / gist:9669041e388646a31bb0
Created March 23, 2015 22:15
CSS text gradient
.gradient {
-webkit-background-clip: text;
-webkit-text-fill-color: transparent; }
.g01 {
color: #005087 !important;
background-image: -webkit-linear-gradient(left, #005087, #009ca7) !important; }
@jruck
jruck / gist:9742401
Last active August 29, 2015 13:57
conditionally loading content based on CSS breakpoints
/* CSS for setting variable within breakpoint */
@media all and (min-width: 45em) {
body:after {
content: 'widescreen';
display: none;
}
}
@jruck
jruck / gist:8024303
Last active December 31, 2015 17:59
minimal-ui for iOS7 Safari
<meta name="viewport" content="minimal-ui">
@jruck
jruck / gist:6831860
Created October 4, 2013 19:58
WP: dynamic home URL
<?php echo home_url(); ?>
@jruck
jruck / gist:6757163
Last active December 24, 2015 06:29
WP: dynamic stylesheet URL
<?php echo get_stylesheet_directory_uri()?>
@jruck
jruck / gist:6757146
Last active December 24, 2015 06:29
HTML: Facebook / Open Graph metadata
<meta property="og:image" content="">
<meta property="og:title" content="">
<meta property="og:description" content="">
<meta property="og:url" content="">
@jruck
jruck / gist:6748365
Last active December 24, 2015 05:09
jQuery: Change class on load
jQuery(window).load(function(){
$('#frame').addClass("ready").removeClass("loading");
});
@jruck
jruck / gist:4965547
Last active February 14, 2018 05:51
WP: force root URL in wp-config
define('WP_HOME','http://DOMAIN.com');
define('WP_SITEURL','http://DOMAIN.com');
@jruck
jruck / gist:4699456
Last active December 12, 2015 02:29
htaccess: migrate WP to Tumblr
Options +FollowSymLinks
RewriteEngine on
# Redirect old popular posts to counterparts on Tumblr
Redirect 301 /old/post/URL http://NEWDOMAIN.TLD/post/1234567890
Redirect 301 /old/post/URL http://NEWDOMAIN.TLD/post/1234567890
# ... and so on
# Redirect old image/media directories to new storage location
Redirect 301 /wp-content/uploads http://NEW.DOMAINFORHOSTINGYOUROLDIMAGES.com/wp-content/uploads
@jruck
jruck / gist:4270084
Last active January 16, 2023 01:30
WP: Minimal wp_oembed_get
// Minimal YouTube & Vimeo embeds
function wp_oembed_get( $url, $args = '' ) {
if(preg_match("/youtube.com\/watch\?v=([^&]+)/i", $url, $aMatch)){
return '<iframe width="640" height="360" src="http://www.youtube.com/embed/' . $aMatch[1] . '?loop=1&modestbranding=1&rel=0&showinfo=0&autohide=1" frameborder="0" allowfullscreen></iframe>';
}
if(preg_match("/youtube.com\/watch\?feature=player_embedded&v=([^&]+)/i", $url, $aMatch)){
return '<iframe width="640" height="360" src="http://www.youtube.com/embed/' . $aMatch[1] . '?loop=1&modestbranding=1&rel=0&showinfo=0&autohide=1" frameborder="0" allowfullscreen></iframe>';
}