Skip to content

Instantly share code, notes, and snippets.

View dabblet.css
#content {
background: #eee;
margin: 30px 300px;
border: 1px solid black;
position: relative;
}
#content:after {
content: "";
display: block;
@mattstauffer
mattstauffer / dabblet.css
Created Jul 9, 2012 — forked from dstorey/dabblet.css
set the size of the boxes and any decoration
View dabblet.css
.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 Jul 19, 2012
Modernizr/Respond.js simple test
View gist:3145416
<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 Aug 6, 2012
Complex Sass breakpoint declaration
View breaks.scss
@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 Oct 4, 2012
Isotope Centered with Gutters
View gist:3835881
// 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 Nov 5, 2012
Simple Javascript snippet performance test
View gist:4018160
// 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
View parents.scss
// SASS
nav {
a {
color: green;
li.selected & {
color: red;
}
}
}
@mattstauffer
mattstauffer / gist:6976202
Created Oct 14, 2013
Clone framework git repo without history for starting a new app -- from @garethdaine in #laravel
View gist:6976202
git clone -b develop --depth=1 git://github.com/laravel/laravel.git myapp
@mattstauffer
mattstauffer / .vimrc
Last active Jul 7, 2016
Vimscripts to easily create PHP class and easily add dependency to PHP class Tweaked versions of a script by Jeffrey Way
View .vimrc
" 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
View gist:8199295
Server {
Port = 8080
SourceRoot = /home/taylor/Test/public/
}
VirtualHost {
* {
Pattern = .*
RewriteRules {
* {