------------------- Sun Nov 21 14:08:26 [bash:5.0.17 jobs:0 error:0] root@tact:/usr/lib/cgi-bin # cat test.sh #!/bin/bash echo 'Content-Type: text/plain' echo '' echo 'test' -------------------
Category Archives: Programming
The relevance of PHP
Seen today: Yes, PHP is Worth Learning/Using in $CURRENT_YEAR. There’s some good discussion on some of the more recent PHP language features and other notes about what’s available in the broader ecosystem.
Kenichi Asai’s Home Page
Ben Eater
So I discovered this guy Ben Eater after watching his video How do hardware timers work?. It looks like he has some cool stuff.
How do hardware timers work?
This looked interesting but I’m too sleepy to watch now… How do hardware timers work?.
Pivot Tables
I think the Laravel developers don’t know what a Pivot Table is. At the time of writing:
If you need to define attributes that should be set on the pivot / intermediate table linking the models, you may use the hasAttached method. This method accepts an array of pivot table attribute names and values as its second argument
The concept they’re looking for is Association Table.
Oh, look. I just noticed this on the Wikipedia article: “pivot table (as used incorrectly in Laravel – not to be confused with the correct use of pivot table in spreadsheets)”; so this has already been discovered.
Tailwind CSS
Getting ready to use Tailwind CSS in anger. I like their headline: “Best practices” don’t actually work.
Factory specialization
I just knocked this up to confirm my thinking was right:
<?php
class StdFeature {
}
class AppFeature extends StdFeature {
}
class FactoryBase {
public function new_feature() : StdFeature { return new StdFeature; }
}
class Factory extends FactoryBase {
public function new_feature() : AppFeature { return new AppFeature; }
}
$factory = new Factory();
$feature = $factory->new_feature();
assert( is_a( $feature, 'AppFeature' ) );
Reflections on 10,000 Hours of Programming
This was good: Reflections on 10,000 Hours of Programming.
Fast indoor 2D localization using ceiling lights
This is awesome: Fast indoor 2D localization using ceiling lights.