- Traditional CSS
- Simple approach, known API
- we would have to deal with namespace conflicts
- leverages browser caching, storing the entire app style in the first load and reducing following reloads
- Style-based implementations
<?php | |
use Luracast\Restler\Restler; | |
use Luracast\Restler\Explorer; | |
require __DIR__ . '/../vendor/autoload.php'; | |
$r = new Restler(); |
#!/usr/bin/env php | |
<?php | |
define('ROOT', dirname(dirname(__DIR__))); | |
chdir(ROOT); | |
$pending_migrations = (int)trim(`./artisan migrate:status --no-ansi | grep -c '| N'`); | |
echo "===> Pending migrations: $pending_migrations"; | |
if ($pending_migrations) { | |
$migrations = array_filter(explode("\n", `./artisan migrate:status --no-ansi | grep '| N'`)); | |
$migrations = array_map(function($line) { return ' > '.trim($line, " |N\t"); }, $migrations); |
//used this through trial and error to find the correct proportions for a progress bar where one element is 10%, with 5 pieces | |
//based on https://stackoverflow.com/a/40094266/102960 | |
function proportionalPieces(proportion, size) { | |
const pieces = [1] | |
for (let i = 1; i < size; i++) { | |
pieces[i] = pieces[i-1] * proportion | |
} | |
const sum = pieces.reduce((acc, piece) => acc + piece) |
Plain and simple, copied from https://data.opendatasoft.com.
Plain and simple, copied from https://data.opendatasoft.com. This includes the 50 states, DC, and the 5 territories.
Mixed the two files above, simplifying extra fields by focusing on subdivision names and abbreviations only.
#!/usr/bin/env python3 | |
############################################################################# | |
# Reproducible example for https://stackoverflow.com/q/78152055/102960 | |
# The objective is to see the presentation line, the prompt line, be able to | |
# answer it, and then have stderr captured and omitted from normal console | |
# output. | |
# Run THIS script from CLI, not script.py | |
############################################################################# | |
import shlex | |
import subprocess |