Skip to content

Instantly share code, notes, and snippets.

View codycraven's full-sized avatar

Cody Craven codycraven

View GitHub Profile
@codycraven
codycraven / settings.json
Created November 21, 2016 18:34
VSCode Drupal 7 settings.json
{
"files.associations": {
"*.module": "php",
"*.install": "php",
"*.inc": "php",
"*.info": "ini"
}
}
@codycraven
codycraven / slack-sidebar-theme-vscode
Created January 11, 2017 23:31
VSCode inspired Slack Sidebar Theme
#252526,#2a2d2e,#1e4771,#FFFFFF,#2a2d2e,#FFFFFF,#519aba,#cbcb41
@codycraven
codycraven / postman.desktop
Created February 15, 2017 23:42
Dash pin-able Postman in Ubuntu Gnome, place in ~/.local/share/applications/ after installation to /opt/ from https://www.getpostman.com/
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Postman
Exec=/opt/Postman/Postman
Icon=/opt/Postman/resources/app/assets/icon.png
@codycraven
codycraven / tampermonkey-tugboat-console-width.js
Created May 31, 2017 17:41
Tampermonkey: Widen the console in Tugboat.qa to be more usable
// ==UserScript==
// @name Tugboat console width
// @namespace http://cravencode.com/
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.18.2/babel.js
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.16.0/polyfill.js
// @include https://dashboard.tugboat.qa/*
// ==/UserScript==
/* jshint ignore:start */
var inline_src = (<><![CDATA[
@codycraven
codycraven / docker-sync--osx-native--repair.sh
Last active May 31, 2017 22:50
docker-sync osx_native unison repair
#!/bin/bash
SYNC_CONTAINER="$1"
getLogfile () {
echo "/tmp/$( docker exec "$SYNC_CONTAINER" ls /tmp/ | grep ^unison-stdout-- )"
}
if [ $# -lt 1 ]; then
>&2 echo "Error: an argument with the docker-sync container name must be passed"
#!/bin/bash
curl -s https://getcaddy.com | bash
which caddy
sleep 5
sudo mkdir /etc/caddy
sudo chown -R root:www-data /etc/caddy
sudo touch /etc/caddy/Caddyfile
#!/bin/bash
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
sleep 5
sudo apt-get install -y docker-ce
#!/bin/bash
# Before running this make sure Caddy and Docker are installed:
# https://gist.github.com/codycraven/bba48dcdcd87a9df4e2bb87834b5a65d
# https://gist.github.com/codycraven/24752be91b676b1c193771a652f4b60d
# Get sudo
sudo echo
# Manual configuration
<?php
function validCheckDigit($number) {
// Reverse digits.
$digits = str_split(strrev($number));
$sumDigits = [];
foreach ($digits as $key => $value) {
// Double every other digit, starting with the check digit.
if ($key % 2 !== 0) {
// Sum tens and ones place when greater than 9.