Skip to content

Instantly share code, notes, and snippets.

View ghanbak's full-sized avatar
🍑
butts

Ethan MacDonald ghanbak

🍑
butts
View GitHub Profile

html5/css3 #HTML5 AND CSS3

HTML5 Shiv

Put this in your <head> to make HTML5 work with frickin IE8.

<!--[if lt IE 9]>
    <script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
@ghanbak
ghanbak / gettin-sassy.md
Last active August 29, 2015 14:01
Some sweet SASSiness I've learned.

sass #SASS

Tips N Tricks with Ian Carrico

http://iamcarrico.github.io/tips-tricks-with-sass/#/

##Changing Color Template

I specifically created this snippet for a school site I was working on to change the colors based on what school pages, within a single Drupal site install, a user was on; the actual code was much longer but reduced a 7000 line CSS file down to 1200 lines of SASS. The school is http://isd191.org and I developed this while working for http://augustash.com. It uses a basic @each statement to select the page template's class then uses if/else logic to change colours based on the school class. Each school had variables associated with each element that had a specific color change.

# Directives to send expires headers and turn off 404 error logging for Static assets
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpe?g|gif|png|ico|zip|pdf|t?gz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|swf|bmp|txt|rtf|md)$ {
access_log off;
log_not_found off;
expires max;
add_header Cache-Control public;
}
@ghanbak
ghanbak / wordpress.md
Last active December 12, 2015 06:58
If you decide to use a static page for posts and front page, this snippet of php is the loop for the blog listing.

wordpress #WORDPRESS

##Blog List Loop

<?php if ( have_posts() ) : ?>

  	<?php twentyeleven_content_nav( 'nav-above' ); ?>

	
@ghanbak
ghanbak / mcrypt-install.md
Last active December 22, 2015 11:19
Install mcrypt the proper way.

The Proper Way to Install MCRYPT

Pinkies High

|| do not use homebrew ||

MAC 10.8

Open up terminal and follow each step exactly.

Preparation

@ghanbak
ghanbak / install-autoconf.md
Last active December 22, 2015 11:29
Stupid xcode doesn't have autoconf anymore? Can't run phpize cause you updated to 10.8? Here's your simple fix.

Autoconf Install for OSX 10.8

You can run this command from anywhere in terminal.

I ran it from /tmp and / (I've done it twice).

curl http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz > autoconf.tar.gz | tar -zx
@ghanbak
ghanbak / drupal.md
Last active May 24, 2017 16:25
A gist for all things I need to know about Drupal.

drupal logo

ALL THINGS DRUPAL

Core Update

run this on / of the project

drush pm-update

javascript

JAVASCRIPT

Dynamic Widths

var P = $('.container div').length;

var W = 100/P+'%';

Pantheon Development

Git Mode

Follow this flow of using Pantheon in git mode:

git status
git add . //or git add <file>
git commit
@ghanbak
ghanbak / command-line.md
Last active May 24, 2017 16:27
Command Line snippets and Git commands