Skip to content

Instantly share code, notes, and snippets.

View maxxcrawford's full-sized avatar

Maxx Crawford maxxcrawford

View GitHub Profile
@maxxcrawford
maxxcrawford / sphere-scale.html
Created February 12, 2014 20:44
CSS Transform/Animation Scale Example ( http://jsfiddle.net/aNX9h )
<!doctype html>
<html>
<head>
<title>CSS animations: Example 1</title>
<style type="text/css">
body {
padding: 20px;
}
@maxxcrawford
maxxcrawford / placeholder-shim.js
Created April 14, 2014 21:37
Placeholder Shim (Modernizr Test)
/* global Modernizr */
(function (app, $, window, document, undefined) {
/* SHIM: <input> placeholder shim
--------------------------------------------------------------------------- */
if(!Modernizr.input.placeholder){
$(document).on('focus', 'input[placeholder], textarea[placeholder]', function() {
var input = $(this);
if (input.val() === input.attr('placeholder')) {
input.val('').removeClass('placeholder');
}
// ImageMagick - Convert SVG to PNG w/ transparency
//
// - open terminal
//
// - confirm you have imagemagick installed
// --- type: convert -v
//
// - cd to folder
//
// - single file
@maxxcrawford
maxxcrawford / randomize.js
Last active August 29, 2015 14:03
Randomize Child Elements
$.fn.randomize = function(selector, callback) {
var $elems = selector ? $(this).find(selector) : $(this).children(),
$parents = $elems.parent();
$parents.each(function() {
$(this).children(selector).sort(function() {
return Math.round(Math.random()) - 0.5;
// }). remove().appendTo(this); // 2014-05-24: Removed `random` but leaving for reference. See notes under 'ANOTHER EDIT'
}).detach().appendTo(this);
});
@maxxcrawford
maxxcrawford / fixed-pos-cover.html
Last active August 29, 2015 14:03
Fixed Position / Cover Image Fix (Src: http://goo.gl/0wkXIk)
<div id="wrapper">
<div id="container"></div>
<p>Scroll Down</p>
</div>
<div id="content">
</div>
@maxxcrawford
maxxcrawford / owlCarouselAutoHeight.js
Created August 8, 2014 15:41
Set All Slides to Tallest Slide in Rotator
function updateSize() {
var rotatorHeight = $('.owl-carousel').height(),
slides = $('.owl-item');
slideSetHeight = slides.first().height();
slides.each(function(){
var slideHeight = $(this).height();
if (slideHeight > slideSetHeight){
slideSetHeight = slideHeight
}
@maxxcrawford
maxxcrawford / fpo.scss
Created October 21, 2014 16:06
FPO Overlay Image
// FPO Caption
.fpo-light {
position: relative;
&::after {
content: "FPO";
font-family: sans-serif;
font-size: 150px;
position: absolute;
width: 100%;
/*
convertVideo_config: {
ffmpeg: 'bin/ffmpeg/./ffmpeg',
mp4: '-vcodec libx264',
m4v: '-vcodec libx264',
'3gp': '-acodec libvo_aacenc -vcodec libx264',
webm: '-acodec libvorbis -vcodec libvpx',
ogv: '-acodec libvorbis'
},
$.scrollLock = ( function scrollLockClosure() {
'use strict';
var $html = $( 'html' ),
// State: unlocked by default
locked = false,
// State: scroll to revert to
prevScroll = {
scrollLeft : $( window ).scrollLeft(),
scrollTop : $( window ).scrollTop()
@maxxcrawford
maxxcrawford / chown.bash
Created May 5, 2015 15:07
Project Permissions Repair
$ sudo chown -R $(whoami): .
# $(whoami) prints your username
# :(blank) rewrites the staff owner as the machine default
# Broco's default groupname is "staff"