Skip to content

Instantly share code, notes, and snippets.

View oojacoboo's full-sized avatar

Jacob Thomason oojacoboo

View GitHub Profile
/**
* Validates a multi-dimensional array against a default "template"
*
* @param string $settingName
* @param array $templateArray
* @param array $newArray
* @param string $depth
*/
private function validateArrayRecursively(
string $settingName,
/**
* Validates a multi-dimensional array against a default "template"
*
* @param string $settingName
* @param array $templateArray
* @param array $newArray
* @param string $depth
*/
private function validateArrayRecursively(
string $settingName,
<?php
class Liger implements Animal
{
public function getSpecies(): LionTiger
{
return new LionTiger();
}
}
user www-data;
# One worker process per CPU core.
worker_processes auto;
pid /var/run/nginx.pid;
pcre_jit on;
error_log /var/log/nginx/error.log warn;
npm WARN www No description
npm WARN www No repository field.
npm ERR! path /var/www
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/var/www'
npm ERR! { [Error: EACCES: permission denied, mkdir '/var/www']
npm ERR! stack: 'Error: EACCES: permission denied, mkdir \'/var/www\'',
@oojacoboo
oojacoboo / varchar-191-utf8mb4.sql
Last active April 27, 2018 03:08
MODIFY COLUMN to varchar(191) from varchar(255) for utfbmb4
SELECT CONCAT('ALTER TABLE `', TABLE_NAME, '` ',
GROUP_CONCAT(CONCAT('MODIFY COLUMN `', COLUMN_NAME, '` VARCHAR(191)')), ';') AS _alter
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'mydatabase'
AND COLUMN_TYPE LIKE 'VARCHAR%'
AND CHARACTER_MAXIMUM_LENGTH = 255
AND CHARACTER_SET_NAME = 'utf8mb4'
GROUP BY TABLE_SCHEMA, TABLE_NAME;
# Validates that the version string is a valid Semantic Version Number
Validate.semver() {
local version="$1"
if [[ ! $version =~ ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$ ]]; then
die "Version, '$version', must be a valid semantic version (semver)"
fi
}
# Gets the version label from the Dockerfile
getVersion() {
app="$1"
image="$2"
return version=$(awk -F= '$1 == "LABEL version" { print $2 }' "$LIB"/../../apps/$app/$image/Dockerfile)
}
Verifying that "oojacoboo.id" is my Blockstack ID. https://onename.com/oojacoboo
import * as React from 'react';
import Header from '../component/Header';
import Footer from '../component/Footer';
interface HeaderFooterProps {
children: JSX.Element;
}
const HeaderFooter: React.StatelessComponent<HeaderFooterProps> = ({ children }) =>
<div>