Skip to content

Instantly share code, notes, and snippets.

@tessalt
tessalt / dropdown.html
Created July 16, 2012 20:05
Screen-reader accessible responsive dropdown
<a class="toggleMenu" href="#">Menu</a>
<ul class="nav clearfix">
<li class="topLvlItem parent">
<a href="#">Item 1</a>
<ul class="subLvlNav">
<li class="subLvlItem subParent">
<a href="#">Browse by Interest</a>
<ul class="btmLvlNav">
<li><a href="#">Sports</a></li>
<li><a href="#">Academics</a></li>
<span class="okselect">
<span class="arrows"></span>
<select name="dietserious" onfocus="this.up().addClassName('focus');" onblur="this.up().removeClassName('focus');">
<option value="0">All Assets</option><option value="1">My Assets</option><option value="2">Strictly</option>
</select>
</span>
@tessalt
tessalt / index.html
Created September 26, 2012 03:12
#selects
<select>
<option>My Assets</option>
<option>All Assets</option>
<option>Other Things</option>
<option>Another really long option</option>
</select>
@tessalt
tessalt / accordions.js
Created November 6, 2012 03:50
PROPER FUCKING ACCORDIONS BITCHEZ
$(".accordion_toggle").live("click", function(e){
e.preventDefault();
$(".accordion_toggle").removeClass("active");
$(".accordion_content").slideUp();
if($(this).next().is(':hidden') == true) {
$(this).addClass("active");
$(this).next().slideDown();
}
});
@tessalt
tessalt / gist:4032115
Created November 7, 2012 15:03
rename shit
for file in *.html.haml ; do cp -i $file `echo $file | sed 's/\(.*\.\)html.haml/\1mobile.haml/'` ; done
@tessalt
tessalt / tabs.coffee
Created November 16, 2012 15:15
tabs
$(".tabs > li > a").click (e) ->
e.preventDefault()
$(".tab").removeClass "active"
$(".tabs > li > a").removeClass "active"
targetTab = $(this).attr("href")
$(targetTab).addClass "active"
$(this).addClass "active"
@tessalt
tessalt / modal.css
Created November 16, 2012 15:19
sometimes-useful modal shit
.overlay {
display: none;
position: absolute;
top: 0;
left:0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.6);
z-index: 20;
}
@tessalt
tessalt / gist:4129203
Created November 22, 2012 02:57
webernets
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Title</title>
</head>
<body>
</body>
</html>
@tessalt
tessalt / gist:4230967
Created December 7, 2012 05:17 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@tessalt
tessalt / extend.scss
Created December 11, 2012 02:01
extends
%clearfix {
&:before, &:after {
content: " ";
display: table;
}
&:after {
clear: both;
}
}