Some good points here: Surprisingly Slow. I’m thinking about installing zstandard for my PHP… see Better Compression with Zstandard for some numbers.
Idempotence Now Prevents Pain Later
I enjoyed reading this one today: Idempotence Now Prevents Pain Later. Some clear thinking.
Ignoring MySQL constraints
You can disable foreign key checks with
SET foreign_key_checks = 0;
And you can disable unique index checks with
SET unique_checks = 0;
A great MySQL session
I found this great MySQL session over here. It has a clever approach for creating a big table, and shows how to invoke shell commands from the `mysql` client.
USE test; SET GLOBAL innodb_file_per_table=1; SET GLOBAL autocommit=0; -- Create an uncompressed table with a million or two rows. CREATE TABLE big_table AS SELECT * FROM information_schema.columns; INSERT INTO big_table SELECT * FROM big_table; INSERT INTO big_table SELECT * FROM big_table; INSERT INTO big_table SELECT * FROM big_table; INSERT INTO big_table SELECT * FROM big_table; INSERT INTO big_table SELECT * FROM big_table; INSERT INTO big_table SELECT * FROM big_table; INSERT INTO big_table SELECT * FROM big_table; INSERT INTO big_table SELECT * FROM big_table; INSERT INTO big_table SELECT * FROM big_table; INSERT INTO big_table SELECT * FROM big_table; COMMIT; ALTER TABLE big_table ADD id int unsigned NOT NULL PRIMARY KEY auto_increment; SHOW CREATE TABLE big_table\G select count(id) from big_table; -- Check how much space is needed for the uncompressed table. \! ls -l data/test/big_table.ibd CREATE TABLE key_block_size_4 LIKE big_table; ALTER TABLE key_block_size_4 key_block_size=4 row_format=compressed; INSERT INTO key_block_size_4 SELECT * FROM big_table; commit; -- Check how much space is needed for a compressed table -- with particular compression settings. \! ls -l data/test/key_block_size_4.ibd
HTML5 Tips
Today via r/programming: HTML5 Tips. I think my favourite was the meter tag… or maybe the spellcheck attribute… lots of good tips over there.
PDOStatement::fetchAll
There’s some really good PHP PDO documentation over here: PDOStatement::fetchAll. Of particular interest were PDO::FETCH_KEY_PAIR, PDO::FETCH_PROPS_LATE, PDO::FETCH_GROUP, and PDO::FETCH_FUNC.
The Tim Ferriss Show #507 – Adam Gazzaley
The Tim Ferriss Show #506 – Balaji Srinivasan
Ryan Bush – A Guide To Mental Self-Mastery
Today I listened to this podcast episode: Ryan Bush – A Guide To Mental Self-Mastery.
CSS Tips
This on r/programming today: CSS Tips. There are a lot of good tricks in there, this one was my fav:
.center {
display: flex;
align-items: center;
justify-content: center;
}
…it centres content vertically and horizontally.