Skip to content

Instantly share code, notes, and snippets.

View tommymarshall's full-sized avatar

Tommy Marshall tommymarshall

View GitHub Profile
@tommymarshall
tommymarshall / nginx.conf
Last active February 22, 2019 19:17
Parking Domains NGINX config
# My changes
server {
listen [::]:80;
server_name domain.com parkeddomain.com;
rewrite ^ http://domain.com$request_uri? permanent;
}
# Forge's default
server {
listen 80;
@tommymarshall
tommymarshall / sobad.js
Created November 19, 2014 16:04
jQuery-less select replace?
var SelectReplace = function( el, callback ) {
this.el = el;
this.callback = callback;
this.focusClassName = 'select-focus';
this.valueClassName = 'select-value';
this.wrapperClassName = 'select-wrapper';
this.setup();
this.bindEvents();
@tommymarshall
tommymarshall / nginx.conf
Created December 5, 2014 16:57
Enable asset compression
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml;
gzip_buffers 128 4k;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
@tommymarshall
tommymarshall / weeeee.js
Created December 11, 2014 20:55
ignore freestyle, and simply call the bell directly.
var startSound = function() {
var handBell = new HandBell('C4')
handBell.initialize()
handBell.ding()
}
@tommymarshall
tommymarshall / custom_user_bindings.sublime-keymap
Last active April 26, 2020 01:04
Custom User Bindings for using AlignTab with ='s, =>'s, and :'s in Sublime Text
[
{
"keys": ["control+alt+;"], "command": "align_tab",
"args" : {
"user_input" : ":/f"
}
},
{
"keys": ["control+alt+="], "command": "align_tab",
"args" : {
%vertically-centered-child
font-size: 0
&:before
content: ''
display: inline-block
height: 100%
vertical-align: middle
@tommymarshall
tommymarshall / nginx.conf
Last active June 10, 2016 23:10
Craft nginx configuration
server {
listen 80;
# route www to non-www
server_name www.clientsite.com;
return 301 $scheme://clientsite.com$request_uri;
}
server {
listen 80 default_server;
server_name clientsite.com;
@tommymarshall
tommymarshall / routes.php
Created January 9, 2015 23:11
Themosis Routes
<?php
// Home
Route::get('home', 'PagesController@home');
// @about method always fires when viewing a page, no matter the page
Route::any('page' , [['about'], 'uses' => 'PagesController@about']);
Route::any('page' , [['vision'], 'uses' => 'PagesController@vision']);
Route::any('archive' , ['blog', 'uses' => 'BlogController@index']);
@tommymarshall
tommymarshall / PagesController.php
Last active August 29, 2015 14:13
Route::post() requests never get matched, requests always end up matching Route::get(). Here's a gif of what's happenning: http://cl.ly/image/3s0X0q2p0r1o
<?php
class PagesController extends BaseController
{
public function home() {
return View::make("pages.home");
}
public function about() {
return View::make("pages.about");
@tommymarshall
tommymarshall / output.json
Created January 15, 2015 20:16
wp api json output
{
"ID":1,
"title":"Hello world!",
"status":"publish",
"type":"post",
"author":{
"ID":1,
"username":"admin",
"name":"admin",
"first_name":"",