Skip to content

Instantly share code, notes, and snippets.

View davist11's full-sized avatar
👨‍💻

Trevor Davis davist11

👨‍💻
View GitHub Profile
$('#nav-global a.control').click(function(e) {
var $link = $(this);
$link.addClass('no-outline');
if($link.hasClass('current')) {
$link.siblings('.global-sub').slideUp(350);
$link.removeClass('current');
} else {
if($('#nav-global > .nav > li > .current').length > 0) {
$('#nav-global > .nav > li > .current').removeClass('current');
$('#nav-global .global-sub').slideUp(350);
;(function($) {
// Equal height items
$.fn.equalHeight = function(options) {
var opts = $.extend({}, $.fn.equalHeight.defaults, options);
return this.each(function() {
var $this = $(this),
o = $.meta ? $.extend({}, opts, $this.data()) : opts,
maxHeight = 0;
@davist11
davist11 / jquery.equalHeight.js
Created July 20, 2010 20:33
Equal heights plugin
;(function($) {
// Equal height items
$.fn.equalHeight = function(options) {
var opts = $.extend({}, $.fn.equalHeight.defaults, options);
return this.each(function() {
var $this = $(this),
o = $.meta ? $.extend({}, opts, $this.data()) : opts,
maxHeight = 0;
@davist11
davist11 / Fancy File Inputs.js
Created October 25, 2010 21:32
Fancy File Inputs
var SITE = SITE || {};
SITE.fileInputs = function() {
var $this = $(this),
$val = $this.val(),
valArray = $val.split('\\'),
newVal = valArray[valArray.length-1],
$button = $this.siblings('.button'),
$fakeFile = $this.siblings('.file-holder');
if(newVal !== '') {
var $settings = array();
var $settings_default = array(
'honeepot_field' => 'honeepot',
'honeepot_error' => 'Sorry, but we think you might be a robot.'
);
// Setup with the default settings
function settings()
{
$settings['honeepot_field'] = $this->settings_default['honeepot_field'];
@davist11
davist11 / mini-calendar.php
Created January 10, 2011 15:39
ExpressionEngine Mini Calendar
{preload_replace:channel="blog"}
{exp:channel:calendar channel="{channel}"
show_future_entries="no" display_by="day"}
<div class="content">
<h3>{date format="%F %Y"}</h3>
<ul class="nav-calendar">
<?php if('{date format="%Y"}' == '2007') : ?>
<?php if ('{date format="%n"}' > '1') : ?>
<li class="prev">
@davist11
davist11 / .bash_profile
Created January 31, 2011 18:30
.bash_profile
alias getpath='pwd | tr -d "\r\n" | pbcopy'
alias ls='ls -lah'
alias go='git checkout'
alias gitdel='git ls-files --deleted | xargs git rm'
source ~/scripts/git-completion.bash
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
@davist11
davist11 / EE2.rss
Created February 10, 2011 17:17
ExpressionEngine 2 RSS
{preload_replace:channel="blog|work"}
{exp:rss:feed channel="{channel}"}
<?xml version="1.0" encoding="{encoding}"?>
<rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:admin="http://webns.net/mvcb/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:atom="http://www.w3.org/2005/Atom">
#something {
background: rgb(69, 67, 67);
background: rgba(69, 67, 67, 0.95);
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 1px 1px 5px rgba(0,0,0,0.5);
-webkit-box-shadow: 1px 1px 5px rgba(0,0,0,0.5);
box-shadow: 1px 1px 5px rgba(0,0,0,0.5);
left: 46px;
<nav>
<ul>
<li><a href="#">Nav Item</a></li>
<li><a href="#">Nav Item</a></li>
<li><a href="#">Nav Item</a></li>
</ul>
</nav>
<section>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>