Skip to content

Instantly share code, notes, and snippets.

View dennyweiss's full-sized avatar

Denny Weiß dennyweiss

View GitHub Profile
@dennyweiss
dennyweiss / SassMeister-input-HTML.html
Created May 5, 2014 18:45
Generated by SassMeister.com.
<div class="box grayscale" data-label="Gray"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="http://kununu.github.io/gray/js/jquery.gray.js"></script>
@dennyweiss
dennyweiss / git-remove-submodule
Created August 12, 2014 15:01 — forked from sharplet/git-remove-submodule
usage: `git-remove-submodule [path/to/submodule]`
#!/bin/sh
#
# Adam Sharp
# Aug 21, 2013
#
# Usage: Add it to your PATH and `git remove-submodule path/to/submodule`.
#
# Does the inverse of `git submodule add`:
# 1) `deinit` the submodule
# 2) Remove the submodule from the index and working directory
@dennyweiss
dennyweiss / reload_chrome.sh
Last active August 29, 2015 14:06 — forked from jhickner/reload_chrome.sh
reload chrome from console
#!/bin/bash
exec <"$0" || exit; read v; read v; exec /usr/bin/osascript - "$@"; exit
-- the above is some shell trickery that lets us write the rest of
-- the file in plain applescript
on run argv
set targetApp to item 1 of argv
set delayInSeconds to item 2 of argv
tell application "Google Chrome"
activate
@dennyweiss
dennyweiss / iMessage.sh
Last active August 29, 2015 14:06 — forked from zhasm/iMessage.sh
#!/bin/bash
exec osascript <<EOF
set peopleICareAbout to {"MyFullName"}
tell application "Messages"
repeat with myBuddy in buddies
if full name of myBuddy is in peopleICareAbout then
send "$*" to myBuddy
end if
end repeat

Project

Description: What does this project do and who does it serve?

Project Setup

How do I, as a developer, start working on the project?

  1. What dependencies does it have (where are they expressed) and how do I install them?
  2. How can I see the project working before I change anything?

How to set up Gulp with an ExpressionEngine project

I freaking love working with technologies like Grunt and Gulp, and wanted to share how to get my current EE front-end workflow set up. With a few tweaks, this can also be used with virtually any other sites (I've used it with Laravel, static sites, Craft, etc).

Install Node.js

  • If Node is not yet installed on the machine, it will need to be installed

Install Gulp (if needed)

/*!
* Grunt
* $ npm install grunt-contrib-uglify grunt-autoprefixer grunt-contrib-cssmin grunt-contrib-imagemin grunt-contrib-sass grunt-contrib-watch grunt-contrib-concat grunt-contrib-clean grunt-contrib-jshint grunt-notify --save-dev
*/
module.exports = function(grunt) {
grunt.initConfig({
// Sass
<?php
class Clean_Walker_Nav extends Walker_Nav_Menu {
/**
* Filter used to remove built in WordPress-generated classes
* @param mixed $var The array item to verify
* @return boolean Whether or not the item matches the filter
*/
function filter_builtin_classes( $var ) {
return ( FALSE === strpos( $var, 'item' ) ) ? $var : '';
}
<?php
add_filter( 'the_content', 'remove_empty_p', 20, 1 );
function remove_empty_p( $content ){
// clean up p tags around block elements
$content = preg_replace( array(
'#<p>\s*<(div|aside|section|article|header|footer)#',
'#</(div|aside|section|article|header|footer)>\s*</p>#',
'#</(div|aside|section|article|header|footer)>\s*<br ?/?>#',
'#<(div|aside|section|article|header|footer)(.*?)>\s*</p>#',
'#<p>\s*</(div|aside|section|article|header|footer)#',