This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
volumes: | |
redisdata: {} | |
mongodata: {} | |
networks: | |
front-external: | |
driver: overlay | |
external: true | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
volumes: | |
acme_json: {} | |
networks: | |
front-external: | |
driver: overlay | |
external: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Jitai | |
// @version 1.3.2 | |
// @description Display WaniKani reviews in randomized fonts, for more varied reading training. | |
// @author Samuel (@obskyr) | |
// @copyright 2016-2018, obskyr | |
// @license MIT | |
// @namespace http://obskyr.io/ | |
// @homepageURL https://gist.github.com/obskyr/9f3c77cf6bf663792c6e | |
// @icon http://i.imgur.com/qyuR9bD.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
@media (min-width: 768px){ | |
body{ padding-top: 150px; } | |
} | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Array to CSV Function | |
// Copyright (c) 2014-2016, Ink Plant | |
// https://inkplant.com/code/array-to-csv | |
// last updated May 10, 2016 | |
function array_to_csv($data,$args=false) { | |
if (!is_array($args)) { $args = array(); } | |
foreach (array('download','line_breaks','return','trim') as $key) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://inkplant.com/code/custom-die | |
<?php | |
function custom_die($args=false,$h1=false,$show_header=true,$show_footer=true) { | |
//note: if $args comes in as a string, it is actually $args['error'] | |
//this lets you access the function in shorthand | |
if (!is_array($args)) { $args = array('error'=>$args); } | |
//get all the options set |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// CSV to Array Function | |
// Copyright (c) 2014-2015, Ink Plant | |
// https://inkplant.com/code/csv-to-array | |
// this version was last updated July 20, 2015 | |
ini_set('auto_detect_line_endings',true); | |
function csv_to_array($file,$args=array()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://inkplant.com/code/csv-to-mysql | |
<?php | |
// CSV to MySQL Function | |
// Copyright (c) 2015, Ink Plant | |
// this version was last updated November 6, 2015 | |
// https://inkplant.com/code/csv-to-mysql | |
ini_set('auto_detect_line_endings',true); | |
function csv_to_mysql($args=array()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://inkplant.com/code/spell-numbers | |
<?php | |
function spellnumber($x,$min=0,$max=100) { | |
if (!preg_match('/^-?([0-9]{1,15})(\.[0-9]+)?$/',$x)) { return $x; } //if not a number less than a quadrillion, leave it alone | |
elseif (strpos($x,'.') !== false) { list($int,$dec) = explode('.',$x); return number_format($int).'.'.$dec; } //if not an intenger | |
elseif (($min !== false) && ($x < $min)) { return number_format($x); } //return numeral if less than minimum | |
elseif (($max !== false) && ($x > $max)) { return number_format($x); } //return numeral if greater than maximum | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://inkplant.com/code/ipv6-to-number | |
<?php | |
function ipaddress_to_ipnumber($ipaddress) { | |
$pton = @inet_pton($ipaddress); | |
if (!$pton) { return false; } | |
$number = ''; | |
foreach (unpack('C*', $pton) as $byte) { | |
$number .= str_pad(decbin($byte), 8, '0', STR_PAD_LEFT); | |
} |