Skip to content

Instantly share code, notes, and snippets.

View mherchel's full-sized avatar

Michael Herchel mherchel

View GitHub Profile
@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'];
@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();
}
<?php
$block = module_invoke('menu', 'block_view', 'main-menu');
print render($block['content']);
?>
@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>
@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 / 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 / settings.php
Last active August 17, 2016 12:19
Settings.php config
$conf['stage_file_proxy_origin'] = 'http://dev.fldrupal.camp';
$conf['stage_file_proxy_origin_dir'] = 'sites/default/files';
$conf['file_private_path'] = '';
$conf['file_temporary_path'] = '/tmp';
$conf['theme_debug'] = true;
$conf['preprocess_css'] = 0; // disable css aggregation
$conf['preprocess_js'] = 0; // disable js aggregation
$conf['image_toolkit'] = 'gd';
$conf['ignore_site_directory_permissions'] = TRUE;
@echo off
::
:: Setup
::
:: 1. The remote computer must be networked with the local computer, and able to be accessed
:: using Windows File Sharing (SMB).
:: 2. Set the paths for the local and remote repository below, WITHOUT A LEADING SPACE
::
:: Directions for use
::
{#
/**
* @file
* Theme override to display a menu.
*
* Available variables:
* - menu_name: The machine name of the menu.
* - items: A nested list of menu items. Each menu item contains:
* - attributes: HTML attributes for the menu item.
* - below: The menu item child items.
#Import MYSQL
gzcat foo.sql.gz | mysql -uroot -ppassword foo