Skip to content

Instantly share code, notes, and snippets.

View mattstauffer's full-sized avatar

Matt Stauffer mattstauffer

View GitHub Profile
@rtablada
rtablada / at.sh
Created February 27, 2014 14:33
Use atom from the command line
ln -s /Applications/Atom.app/Contents/Resources/app/atom.sh ~/bin/atom
@frankdejonge
frankdejonge / gist:5c19f8e7ce329dbcc1ef
Created June 10, 2014 18:38
Flysystem and user downloads
<?php
$stream = $fs->readStream($file);
// send the right headers
header("Content-Type: " . $fs->getMimetype($file));
header("Content-Length: " . $fs->getSize($file));
header("Content-disposition: attachment; filename=\"" . basename($file) . "\"");
// dump the attachement and stop the script
@JeffreyWay
JeffreyWay / presentationPrep.js
Created April 6, 2012 22:11
I wish it could be that simple. Something for me to build.
presentation
.title('My Great Presentation')
.slide({
title: 'Learn About Borders',
bullets: [
'Thing 1',
'Thing 2',
],
code: ['path/to/file.css', [2,4]] // path to file, lines to grab
@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);
@include handhelds {
table.responsive {
width: 100%;
thead {
display: none;
}
tr {
display: block;
}
td, th {
/**
* Taken from http://paste.laravel.com/b8n
* and added a datum attr to submit data along with the RESTful request
*
* Restfulize any hiperlink that contains a data-method attribute by
* creating a mini form with the specified method and adding a trigger
* within the link.
* Requires jQuery!
*
* Ex in Laravel:
@airportyh
airportyh / jsconf_slides_codes_and_notes.md
Last active June 19, 2017 20:51
JSConf 2014 Slides, Codes and Notes.

JSConf Slides, Codes and Notes

These are all the JSConf 2014 slides, codes, and notes I was able to cull together from twitter. Thanks to the speakers who posted them and thanks to @chantastic for posting his wonderful notes.

Modular frontend with NPM - Jake Verbaten (@Raynos)

@MattWilcox
MattWilcox / wp-config.php
Created March 18, 2013 14:38
Bits to add to wp-config.php to make things sane when developing in a real development system (local > stage > live) instead of developing directly on a live server. Which is what WP is set up to do and which is ridiculous.
/* Lets not rely on paths in the database, they can be very wrong when moving between dev/stage/live environments */
/* The following two variables are backward to my thinking, but hey, what ya gonna do? */
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . ''); // This is NOT the 'wordpress admin area' home, but the site's home
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/SECRETDIRECTORY'); // This isn't the site's URL but the WordPress admin area URL
/* MySQL settings */
switch($_SERVER['SERVER_NAME']){
// Your local machine's settings
case 'mysite.local':
define('DB_NAME', 'dev_mysite');
@wesrice
wesrice / _base.twig
Last active October 2, 2019 18:02
Sample Modular Templating for Craft CMS - Inspired by principles from https://smacss.com/.
<!DOCTYPE html>
<head>
{# Base #}
{% includeCssFile 'layouts/base/css/base.css' %}
{% includeJsFile 'layouts/base/js/base.js' %}
{# Header #}
{% includeCssFile 'modules/header/css/header.css' %}
{% includeJsFile 'modules/header/js/header.js' %}

Setup PHP Code Sniffer in Sublime Text

The PHP Code Sniffer helps identity violations again coding standards (ie. PSR) as well as syntax errors in your code. The following tutorial explains how to setup the PHP Code Sniffer in Sublime Text (on OSX). This has been tested in Sublime Text 2 and Sublime Text 3.

1. Install PHP_CodeSniffer

Using Pear

You can use Pear, but that's just confusing, and requires you to have Pear installed. Move on to the next option.