This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getFirstSegment() { | |
var path = window.location.pathname; | |
seg1 = path.split("/")[1]; | |
return seg1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i input_file.mp4 -codec:v libx264 -profile:v high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -codec:a libfdk_aac -b:a 128k output_file.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery plugin to prevent double submission of forms | |
jQuery.fn.preventDoubleSubmission = function() { | |
$(this).on('submit',function(e){ | |
var $form = $(this); | |
if ($form.data('submitted') === true) { | |
// don't submit | |
e.preventDefault(); | |
} else { | |
// set data attr to true for next time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toggleOverlay() { | |
if (document.getElementById('overlay') != null) { | |
console.log(true); | |
$('#overlay').fadeOut(300,function(){ | |
$(this).remove() | |
}); | |
} else { | |
var overlay = document.createElement('div'); | |
overlay.id = 'overlay'; | |
overlay.className = 'mfp-bg'; /* use existing styles */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// usage: <span aria-hidden="true" class="u-icon--chevron--left"></span> | |
// → | |
.u-icon--arrow--right:before { | |
content: '\279E'; | |
} | |
// ❯ | |
.u-icon--chevron--right:before { | |
content: '\276F'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO: add keyboard listeners and aria attributes (expanded, haspopup) | |
///////////////////////// | |
////// HTML | |
/////////////// | |
<div class="drawer trigger-drawer-open is-drawer-closed"> | |
<div class="drawer-hd"> | |
<span class="pull-left" data-target="drawer-bd"><span class="icon--arrow--closed"></span></span> | |
<h3 class="drawer-title">Drawer header indicates drawer-bd content</h3> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dataJson = {}, | |
dataArray = []; | |
// assuming a JSON structure like this: | |
dataJson = { | |
"key1": { | |
"prop1": "val1", | |
"prop2": "val2" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.fadeOutAndRemove = function(speed){ | |
$(this).fadeOut(speed,function(){ | |
$(this).remove(); | |
}) | |
} | |
// use like $('div').fadeOutAndRemove(200); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$.fn.extend({ | |
//pass the options variable to the function | |
alert: function(options) { | |
//Set the default values | |
var defaults = { | |
pull: 'right', |