Skip to content

Instantly share code, notes, and snippets.

@apmarshall
apmarshall / 0_reuse_code.js
Created April 30, 2014 23:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@apmarshall
apmarshall / brew.sh
Last active October 22, 2015 16:13
Default Installation Script for Homebrew - @mathiasbynens/dotfiles
#!/usr/bin/env bash
# Install command-line tools using Homebrew.
# Ask for the administrator password upfront.
sudo -v
# Keep-alive: update existing `sudo` time stamp until the script has finished.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@apmarshall
apmarshall / set-defaults.sh
Last active October 23, 2015 20:46
OSX Defaults - @mathiasbynens/dotfiles
#!/usr/bin/env bash
# Modified from ~/.osx — https://mths.be/osx
# Meant to be included in my personal version of dotfiles by @holman
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@apmarshall
apmarshall / org-mode-reference-in.org
Created November 12, 2015 20:42 — forked from drj42/org-mode-reference-in.org
This is a cheat sheet for Emacs org-mode... in org-mode format!
@apmarshall
apmarshall / nginx.conf
Created November 25, 2015 16:35
Boilerplate Config file for nginx, originally written for a Joomla instal. @nikosdion/master-htaccess
server {
######################################################################
## The Master .htaccess - NginX adaptation
##
## Version 3.3
##
## This file is designed to be the template NginX server configuration file
## for your Joomla! sites. You should go through all of its sections and
## modify it to match your site. Most notably, all instances of example.com
## and example\.com should be replaced with your real domain name.
@apmarshall
apmarshall / vultr-coreos-bootstrap.sh
Last active January 12, 2016 20:31 — forked from janeczku/vultr-coreos-bootstrap.sh
Cloud-config for CoreOS IPXE deployment on Vultr. Provisioning etcd, fleet, private network and docker compatible firewall.
#!/bin/bash
# Cloud-config for CoreOS IPXE deployment on Vultr
##################################################
# This cloud-config bootstraps CoreOS on /dev/vda and provisions:
# - private ip-address on eth1
# - etcd2 on private network
# - fleet on private network
# - basic firewall (docker compatible)
# - SSHd security hardening
##################################################
@apmarshall
apmarshall / customizer.php
Created February 1, 2017 15:12
Custom Customizer controls for Showcasing Chosen Category and Pages in WordPress
// Customizer controls
// Custom Control for Category Dropdown
if (class_exists('WP_Customize_Control')) {
class WP_Customize_Category_Control extends WP_Customize_Control {
/**
* Render the control's content.
*
* @since 3.4.0
*/
@apmarshall
apmarshall / iframes.css
Created February 9, 2017 15:46
Responsive i-frames
.iframe-container {
position: relative;
height: 0;
overflow: hidden;
margin-top: 16px;
margin-bottom: 16px;
}
.iframe-container-16x9 {
padding-bottom: 56.25%;
@apmarshall
apmarshall / signature.html
Created September 19, 2017 11:33
Email Signature
<table style="font-family:Georgia;font-size:90%;">
<tbody><tr>
<td style="padding: 0 12px 0 0;" valign="top">
<img style="
width: 100px;
moz-border-radius: 0%;
khtml-border-radius: 0%;
o-border-radius: 0%;
webkit-border-radius: 0%;
ms-border-radius: 0%;