Skip to content

Instantly share code, notes, and snippets.

View mherchel's full-sized avatar

Michael Herchel mherchel

View GitHub Profile
@mherchel
mherchel / timelineLog.js
Last active August 29, 2015 14:13
Consistently log scroll interactions for timeline debugging
console.timeline();
$('body').animate({ scrollTop: 2800 }, 12000, 'linear', function() {
console.timelineEnd();
});
@mherchel
mherchel / Gruntfile.js
Created November 12, 2014 23:45
Libsass/Nodesass/Grunt
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
sass: {
files: ['sass/**/*.{scss,sass}','sass/_partials/**/*.{scss,sass}'],
tasks: ['sass:dist']
},
livereload: {
files: ['*.html', '*.php', 'js/**/*.{js,json}', 'css/*.css','img/**/*.{png,jpg,jpeg,gif,webp,svg}'],
@mherchel
mherchel / SassMeister-input-HTML.html
Created September 24, 2014 19:35
Generated by SassMeister.com.
<div class="ff-worky">Works in Firefox.</div>
<div class="ff-no-worky">Does not work in Firefox.</div>>
<div class"base">base</div>
<div class"test">base64</div>
<?php
$block = module_invoke('menu', 'block_view', 'main-menu');
print render($block['content']);
?>
@mherchel
mherchel / gist:70b25db7dca7c44f5956
Last active August 29, 2015 14:06
Equal Heights Flexbox Fallback
/**
* Set divs to equal heights.
*/
function equalheight(selector, bypassCheck) {
if (($(window).width() > 720) && ((bypassCheck == 1) || !(Modernizr.flexbox) || !(Modernizr.flexboxlegacy))) {
var maxHeight = 0;
$(selector).each(function(){
if ($(this).height() > maxHeight) {
maxHeight = $(this).height();
}
@mherchel
mherchel / gist:ba36d3979b392b1b51d7
Created August 28, 2014 16:37
Add level indicator css class to all menu items and menu links within Drupal theme
<?php
/*
* Add level indicator css class to all menu items and menu links.
*/
function THEME_menu_link(array $variables) {
$element = $variables['element'];
$sub_menu = '';
$element['#attributes']['class'][] = 'menu-item menu-item--level' . $element['#original_link']['depth'];