Skip to content

Instantly share code, notes, and snippets.

View Natetronn's full-sized avatar

Nathan Doyle Natetronn

View GitHub Profile
@balupton
balupton / README.md
Last active September 29, 2018 18:31
Responsive layouts in stylus

Responsive layouts in stylus

Why this way?

  1. There is no span1..15 styles, instead your css defines your layout and your html remains semantic and not polluted with display information. As it should be.

  2. The markup is incredibly easy, you specify the wrappers width, and then each columns width in percentages. Every other grid framework I've found is incredibly complicated with this.

  3. It allows you to have the exact same markup, and completely different styles for different devices, resolutions, stylesheets, whatever. As it should be.

@siffring
siffring / .htaccess
Created March 4, 2012 17:33
htaccess to password protect a specific server
# ----------------------------------------------------------------------
# Password protect staging server
# Use one .htaccess file across multiple environments
# (e.g. local, dev, staging, production)
# but only password protect a specific environment.
# ----------------------------------------------------------------------
SetEnvIf Host staging.domain.com passreq
AuthType Basic
AuthName "Password Required"
@ykarikos
ykarikos / png2svg.sh
Created June 7, 2012 22:17
Convert png to svg using imagemagick and potrace
#!/bin/bash
if [ "$1" == "" ]; then
echo Usage: $0 pngfile
exit 0;
fi
FILE=`basename $1 .png`
if [ ! -e $FILE.png ]; then
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@MaxLazar
MaxLazar / .htaccess
Created August 23, 2012 17:47
ExpressionEngine .htaccess template
# Standard .htaccess file
# Secure .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>
# Don't show any directory without an index file
Options -Indexes
@croxton
croxton / stash_nested_embeds.md
Created October 29, 2012 14:23
Stash & template partials - nested embed

Required:

Stash 2.3.4 (beta) or later

Stash template directory

	/layouts/
		standard.html

	/partials/

listing.html

@jakebellacera
jakebellacera / how-to-install-memcache-on-mamp-2.md
Last active July 4, 2021 16:09
How To Install Memcache on MAMP 2

How To Install Memcache on MAMP 2

Note: This is an old guide and may not work for newer versions of macOS. Please see comments below for additional steps.

  1. Install memcached. I'd suggest using homebrew. brew install memcached
  2. Select your desired version of PHP that you'd like to use in MAMP. This dropdown is located in the PHP tab in MAMP PRO.
  3. Visit the Downloads Page on php.net and download the source code. If your release isn't listed, visit the Releases page.
  4. Extract the source into /Applications/MAMP/bin/php/[php version folder]/include/php.
  5. /Applications/MAMP/bin/php/[php version folder]/include/php/configure
  6. /Applications/MAMP/bin/php/[php version folder]/bin/pecl i memcache.
//for PHP 5.2
$dateTime = new DateTime();
$dateTime->setTimezone(new DateTimeZone('America/New_york'));
$date = getdate();
$dateTime->setDate($date['year'], $date['mon'], $date['mday']);
$dateTime->setTime($date['hours'], $date['minutes'], $date['seconds']);
$conf['daylight_savings'] = (bool) $dateTime->format('I') ? 'y' : 'n';
@davist11
davist11 / ext.php
Last active December 16, 2015 22:09
EE Entry previewing
<?php
public function sessions_end($session)
{
if ($session->userdata['can_access_cp'] === 'y') {
$new_global_vars['gv_can_preview'] = TRUE;
} else {
$new_global_vars['gv_can_preview'] = FALSE;
}
@adamwiggall
adamwiggall / Keep Directories
Last active December 20, 2015 18:38
Often you have a directory in a git repo that you want to share amongst developers, but you don't want the contents tracked. As git ignores empty directories, if you just .gitignore the directory completely it will never get added to the repo and shared. The example shows how to use this technique for the cache folder in an expressionengine inst…
From the command line
$ touch your/path/to/expressionengine/cache/.gitkeep
In your .gitignore file
your/path/to/expressionengine/cache/*
!your/path/to/expressionengine/cache/.gitkeep