Skip to content

Instantly share code, notes, and snippets.

View raoulwegat's full-sized avatar

Raoul Wegat raoulwegat

View GitHub Profile
@raoulwegat
raoulwegat / gist:ded7ec7892e017b6d3c5
Created March 19, 2015 01:51
Wordpress RICG Responsive Images + Advanced Custom Fields in a Gallery + Cycle2
// Responsive Slideshow in Wordpress
// https://github.com/ResponsiveImagesCG/wp-tevko-responsive-images
// http://www.advancedcustomfields.com/pro
// http://jquery.malsup.com/cycle2/
$images = get_field('gallery');
if( $images ): ?>
<div class="cycle-slideshow"
@raoulwegat
raoulwegat / Set parent height of absolutely positioned child.js
Last active December 16, 2015 21:29
Set parent height of absolutely positioned child
// set figure heights based on child image + figcaption heights
$(document).ready(function(){
setFigureHeight();
$(window).on('resize', setFigureHeight);
});
function setFigureHeight() {
$('.story-image').each(function(index,value) {
imgHeight = $(this).outerHeight(true);
capHeight = $(this).next('figcaption').outerHeight(true);
figHeight = imgHeight + capHeight;
@raoulwegat
raoulwegat / Add Site to DNS.scpt
Created November 25, 2012 08:43
OS X service to add folder name to localhost DNS
tell application "Finder"
set theItems to selection
set folderName to name of item 1 of theItems
do shell script "sudo dscl localhost -create /Local/Default/Hosts/" & folderName & ".dev IPAddress 127.0.0.1"
end tell