Skip to content

Instantly share code, notes, and snippets.

View adeubank's full-sized avatar
🌳

Allen Eubank adeubank

🌳
View GitHub Profile
@adeubank
adeubank / gist:2a033900ed57e59da5b2
Created March 19, 2015 19:47
Exit a shell script on a failing command
# http://stackoverflow.com/questions/13793836/how-to-detect-if-a-git-clone-failed-in-a-bash-script
# Here are some common forms.
# Which is the best to choose depends on what you do.
# You can use any subset or combination of them in a single
# script without it being bad style.
if ! failingcommand
then
echo >&2 message
@adeubank
adeubank / gist:172b42192ce609a45144
Created March 30, 2015 17:03
Internet Explorer Version detection and append a ie class to the body
var internetExplorerVersion = (function (){
if (window.ActiveXObject === undefined) return null;
if (!document.querySelector) return 7;
if (!document.addEventListener) return 8;
if (!window.atob) return 9;
if (!document.__proto__) return 10;
return 11;
})();
if (internetExplorerVersion) {
@adeubank
adeubank / gist:fcbc5304ca61cefa5b3b
Created April 1, 2015 23:26
BEM with namespace HTML
<!DOCTYPE html>
<html>
<head>
<title>BEM with Namespace</title>
</head>
<!-- example of that BEM NAMESPACED -->
<body class="t-light">
@adeubank
adeubank / Makefile
Last active August 29, 2015 14:18 — forked from wolfeidau/Makefile
REPORTER = spec
all: jshint test
test:
@NODE_ENV=test ./node_modules/.bin/mocha --recursive --reporter $(REPORTER) --timeout 3000
jshint:
jshint lib examples test index.js
@adeubank
adeubank / default
Last active August 29, 2015 14:26
Simple PHP Nginx configuration for Ubuntu 14.04 after default installations
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /vagrant;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
@adeubank
adeubank / Vagrantfile
Created August 7, 2015 01:58
Vagrantfile for Ubuntu 14.04 running a LEMP stack for wordpress.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@adeubank
adeubank / selenium
Last active August 1, 2019 17:25
Set up selenium on Ubuntu 16.04 as a service
#!/bin/bash
case "${1:-''}" in
'start')
if test -f /tmp/selenium.pid
then
echo "Selenium is already running."
else
export DISPLAY=localhost:99.0
java -Dwebdriver.gecko.driver="/usr/lib/geckodriver/geckodriver" -jar /usr/lib/selenium/selenium-server-standalone.jar -port 4444 > /var/log/selenium/output.log 2> /var/log/selenium/error.log & echo $! > /tmp/selenium.pid
@adeubank
adeubank / wordpress-wp-super-cache.conf
Created August 17, 2015 20:03
Wordpress Super Cache nginx configuration
# WP Super Cache rules.
# Designed to be included from a 'wordpress-ms-...' configuration file.
set $cache_uri $request_uri;
# POST requests and urls with a query string should always go to PHP
if ($request_method = POST) {
set $cache_uri 'null cache';
}
@adeubank
adeubank / setup_php70_stack.sh
Last active May 5, 2017 17:06 — forked from rrosiek/install_mysql.sh
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Outputs nearly everything to /dev/null since "quiet" on most commands is still noisy.
#! /usr/bin/env bash
# Variables
APPENV=local
DBHOST=localhost
DBNAME=dbname
DBUSER=dbuser
DBPASSWD=test123
echo -e "\n--- Mkay, installing now... ---\n"
@adeubank
adeubank / setup_php56_stack.sh
Last active December 21, 2015 07:24
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Outputs nearly everything to /dev/null since "quiet" on most commands is still noisy. Raw
#! /usr/bin/env bash
# Variables
APPENV=local
DBHOST=localhost
DBNAME=dbname
DBUSER=dbuser
DBPASSWD=test123
echo -e "\n--- Mkay, installing now... ---\n"