Skip to content

Instantly share code, notes, and snippets.

View nathos's full-sized avatar

Nathan Henderson nathos

View GitHub Profile
@nathos
nathos / sass-hash-mixin.sass
Last active May 10, 2017 09:10
Using lists like a hash in Sass
@mixin category-colors($after: false)
@each $category in $categories
@if $after == true
.cat-#{nth($category, 1)}:after
background-color: nth($category, 2)
@else
.cat-#{nth($category, 1)}
background-color: nth($category, 2)
@nathos
nathos / semantic_twitter_boostrap_grid.sass
Created February 10, 2012 20:32
A start for semantic grids in Twitter Bootstrap
// clearly, still in progress...
$fluidLayout: true
$fluidLayout: false !default
// Semantic grid mixins
@mixin row($fluid: $fluidLayout)
@if $fluid == true
width: 100%
@nathos
nathos / gist:2509870
Created April 27, 2012 14:49
Installing Sass & Compass on Mac OS X 10.5 Leopard (for @iDGS)
  1. Install Xcode 3.1.4 from: https://developer.apple.com/downloads/

  2. Install Homebrew by pasting the following into your terminal:

    /usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"

  3. Install Git by typing the following into your terminal:

    brew install git

@nathos
nathos / scrollinglinks.js
Created April 27, 2012 18:02
jQuery Smooth Scrolling Internal Links
@nathos
nathos / no-select.scss
Last active April 3, 2020 23:44
Sass (SCSS) mixin to disable user-select on an element
@mixin no-select {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@nathos
nathos / statamic_remove_slashes.htaccess
Created January 26, 2013 22:49
tweaked .htaccess for automatically removing (and redirecting) URLs with trailing slashes with Statamic (http://statamic.com).
RewriteEngine On
RewriteRule ^(_app) - [F,L]
RewriteRule ^(_config) - [F,L]
RewriteRule ^(_content) - [F,L]
RewriteRule ^(.*).yml$ - [F,L]
RewriteRule ^(.*).yaml$ - [F,L]
RewriteRule ^(.*).html$ - [F,L]
RewriteRule ^(.*/)?\.git+ - [F,L]
@nathos
nathos / FontAwesomeIndex.html
Created January 30, 2013 21:10
Quick 'n' dirty index of the FontAwesome icons, so you can easily copy/paste them into the mockup app of your choice (e.g.: Keynote).
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css" media="all">
@font-face {
font-family: 'FontAwesome';
src: url('http://github.com/FortAwesome/Font-Awesome/raw/master/font/fontawesome-webfont.eot');
src: url('http://github.com/FortAwesome/Font-Awesome/raw/master/font/fontawesome-webfont.eot?#iefix') format('eot'), url('http://github.com/FortAwesome/Font-Awesome/raw/master/font/fontawesome-webfont.woff') format('woff'), url('http://github.com/FortAwesome/Font-Awesome/raw/master/font/fontawesome-webfont.ttf') format('truetype'), url('http://github.com/FortAwesome/Font-Awesome/raw/master/font/fontawesome-webfont.otf') format('opentype'), url('http://github.com/FortAwesome/Font-Awesome/raw/master/font/fontawesome-webfont.svg#fontAwesome') format('svg');
@nathos
nathos / sublime-user-preferences.json
Created February 11, 2013 21:16
My user preferences for Sublime Text 2
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_indent": true,
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Cobalt.tmTheme",
"create_window_at_startup": false,
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
@nathos
nathos / diagonal-stripe-mixin.sass
Last active December 17, 2016 01:54
Diagonal CSS stripe Sass/Compass mixin.
@mixin striped-bg($bg-color: #ccc, $darken-amount: 5%, $stripe-color: darken($bg-color, $darken-amount))
background-color: $bg-color
@include background-image(linear-gradient(-45deg, $stripe-color 25%, transparent 25%, transparent 50%, $stripe-color 50%, $stripe-color 75%, transparent 75%, transparent))
background-size: 40px 40px
.warning
font-family: sans-serif
font-weight: bold
color: #333
text-align: center
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_indent": true,
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Cobalt.tmTheme",
"create_window_at_startup": false,
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":