Skip to content

Instantly share code, notes, and snippets.

View maxxcrawford's full-sized avatar

Maxx Crawford maxxcrawford

View GitHub Profile
@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"
@maxxcrawford
maxxcrawford / fizzbuzz.html
Last active December 30, 2019 21:28
FizzBuzz Proof – JavaScript
<!-- Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”." -->
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 80px;
height: 20px;
line-height: 20px;
@maxxcrawford
maxxcrawford / fizzbuzz-compare.html
Created May 27, 2015 18:53
FizzBuzz Test Comparison
<!-- Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”." -->
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 80px;
height: 20px;
line-height: 20px;
@maxxcrawford
maxxcrawford / morph-button.html
Created September 30, 2015 19:50
Morph Button
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Video Player</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
*, *:before, *:after {
box-sizing: border-box;
}