#API domains
https://desktopapps.ryanair.com
##Airports
| /** | |
| * @param $folderName | The full directory name | |
| * @param $maxAge | Max Age in seconds. 172800 = 2 days. | |
| */ | |
| private function recursivelyPruneDirectory($folderName, $maxAge = 60) | |
| { | |
| $items = array_diff(scandir($folderName), ['.','..']); | |
| foreach ($items as $fileOrFolder) { |
| phpcs --config-set default_standard PSR12 |
| <?php | |
| namespace App\Traits; | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Support\Collection; | |
| trait GenericTransformerTrait | |
| { | |
| /** |
| function isNumber(input) { | |
| return !isNaN(+input); | |
| } |
| # | |
| # Usage: | |
| # - have all svg's in a particular folder | |
| # - cd into that folder | |
| # - call the script with the desired size as a parameter | |
| # python svg-to-png.py 500 | |
| # | |
| # | |
| import glob | |
| import os |
| function returnDefault(defaultReturn) { | |
| return typeof defaultReturn === 'undefined' ? null : defaultReturn; | |
| } | |
| /** | |
| * Usage: | |
| * const obj = { id: 123, name: "John Doe", info: { married: false, partner: { id: 456, name: 'Mary Brown' } } } | |
| * const defaultValue = '/'; | |
| * const dotProp = 'info.partner.name' | |
| * |
| # -*- coding: utf-8 -*- | |
| # MySQL Workbench Python script | |
| # | |
| # <description> | |
| # Written in MySQL Workbench 6.3.6 | |
| # Fetch all tables, | |
| # For each table, add created_at, updated_at, deleted_at timestamps, | |
| # Except for many-to-many tables | |
| # Configurable options: | |
| # addDeletedAt: True / False. Add the deleted_at timestamp column |
| <?php | |
| /** | |
| * Class NearestValue | |
| * Finds the 'nearest value' of a needle in a SORTED numeric array (ascending) | |
| * Via https://stackoverflow.com/a/22375510/237739 | |
| * | |
| * Usage: | |
| * $array = [1000,2000,3000,4000,5000]; | |
| * $needle = 1337; |
| # -*- coding: utf-8 -*- | |
| # MySQL Workbench Python script | |
| # | |
| # <description> | |
| # Written in MySQL Workbench 6.3.6 | |
| import grt | |
| # get a reference to the schema in the model. This will get the 1st schema in it. |