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 | |
// An example of receiving file(s) POSTed by an HTML web form (PHP language) | |
// | |
// Please add any necessary path and file handling, security, etc. that you require. | |
// | |
// By Andrew Kingdom | |
// MIT license | |
// | |
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
// Returns the minimum download limit specified in the current php.ini file. | |
// | |
// By Andrew Kingdom | |
// MIT license | |
function max_upload_size() { | |
$max_size = PHP_INT_MAX; | |
$post_overhead = 2048; // Reserve 2k for non-file data in the POST. | |
$tmp = shorthand_bytes(ini_get('upload_max_filesize')); |
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
// Means to provide an alias to a value | |
// in a similar manner to Objective-C | |
// since Swift does not permit duplicate raw values | |
// | |
// By Andrew Kingdom | |
// MIT license | |
enum SomeOption : Int | |
{ | |
case First = 0 |
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
//application/javascript | |
// | |
// Demonstrates callback from a class method | |
// By Andrew Kingdom | |
// MIT license | |
// Define a class | |
let MyClass1 = class { | |
constructor(initialValue) { | |
this.prop = initialValue; // store the parameter value in a property |
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
//application/javascript | |
// | |
// A simple sequential calculator. | |
// By Andrew Kingdom | |
// MIT license | |
// | |
// Operator order/precedence is ignored. | |
// The calculation string is expected to have numbers and operators separated by spaces. | |
// | |
function operate(x,oper,y) { |
NewerOlder