Skip to content

Instantly share code, notes, and snippets.

View mattstauffer's full-sized avatar

Matt Stauffer mattstauffer

View GitHub Profile
#content {
background: #eee;
margin: 30px 300px;
border: 1px solid black;
position: relative;
}
#content:after {
content: "";
display: block;
@mattstauffer
mattstauffer / dabblet.css
Created July 9, 2012 16:53 — forked from dstorey/dabblet.css
set the size of the boxes and any decoration
.slider {
/* set initial width */
width: 520px;
/* hide the content that overflows (to allow second box to show through) */
overflow: hidden;
display: inline-block;
/* skew container so that it has angled edge, and set up transition */
transform: skewX(-20deg);
@mattstauffer
mattstauffer / gist:3145416
Created July 19, 2012 17:15
Modernizr/Respond.js simple test
<script>
// Using Modernizr (http://modernizr.com/) and respond.js
// (https://github.com/scottjehl/Respond/), test the browser for
// Media Query compatibility and load respond.js polyfill if necessary.
Modernizr.load([
{
test: Modernizr.mq('only all'),
nope: 'js/vendor/respond.min.js'
}
]);
@mattstauffer
mattstauffer / breaks.scss
Created August 6, 2012 20:57
Complex Sass breakpoint declaration
@function column-width($cols) {
@return 90px * $cols;
}
@function column-under-width($cols) {
@return (90px * $cols) - 1;
}
@function over-mq($w) {
@return "screen and (min-width: #{$w})";
}
@function under-mq($w) {
@mattstauffer
mattstauffer / gist:3835881
Created October 4, 2012 19:35
Isotope Centered with Gutters
// Tweaked form of Isotope gutters hack ( https://gist.github.com/2574891 ) and
// centered masonry hack (http://isotope.metafizzy.co/custom-layout-modes/centered-masonry.html )
//
// No guarantees; there are even @todos and FIXMEs in here. This is just what I cobbled together
// for a particular project, and I only tweaked it enough to be sure it worked on that project.
$.Isotope.prototype._getMasonryGutterColumns = function() {
// Tweak: Renamed call of this.options.masonry to this.options (not sure why it was wrong in example)
var gutter = this.options.gutterWidth || 0;
@mattstauffer
mattstauffer / gist:4018160
Created November 5, 2012 16:36
Simple Javascript snippet performance test
// Simple Perf test on javascript snippets ( from http://coding.smashingmagazine.com/2012/11/05/writing-fast-memory-efficient-javascript/ )
var totalTime,
start = new Date,
iterations = 1000;
while (iterations--) {
// Code snippet goes here
}
// totalTime → the number of milliseconds taken
// to execute the code snippet 1000 times
// SASS
nav {
a {
color: green;
li.selected & {
color: red;
}
}
}
@mattstauffer
mattstauffer / gist:6976202
Created October 14, 2013 14:05
Clone framework git repo without history for starting a new app -- from @garethdaine in #laravel
git clone -b develop --depth=1 git://github.com/laravel/laravel.git myapp
@mattstauffer
mattstauffer / .vimrc
Last active July 7, 2016 03:23
Vimscripts to easily create PHP class and easily add dependency to PHP class Tweaked versions of a script by Jeffrey Way
" Note: To add this to your .vimrc, you'll have to delete any character that is written with a caret (e.g. "^M") and enter the real value; to enter ^M, enter insert mode and type CTRL-V CTRL-M.
" Easily create class.
function! Class()
let name = input('Class Name? ')
let namespace = input('Any Namespace? ')
if strlen(namespace)
exec 'normal i<?php namespace ' . namespace . ';^M^M^['
else
@mattstauffer
mattstauffer / gist:8199295
Created December 31, 2013 16:40
Taylor Otwell's initial HHVM config for laravel ( https://twitter.com/taylorotwell/status/418057634378301440 )
Server {
Port = 8080
SourceRoot = /home/taylor/Test/public/
}
VirtualHost {
* {
Pattern = .*
RewriteRules {
* {