This file contains 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
https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL | |
https://www.postgresql.org/docs/current/sql-createindex.html | |
https://www.postgresql.org/docs/current/datatype-json.html | |
https://www.postgresql.org/docs/current/functions-json.html | |
https://www.postgresql.org/docs/current/ltree.html | |
https://notso.boringsql.com/posts/how-not-to-change-postgresql-column-type/ | |
https://patshaughnessy.net/2017/12/12/installing-the-postgres-ltree-extension | |
https://pganalyze.com/blog/5mins-postgres-17-incremental-backups | |
https://www.mydbops.com/blog/postgresql-17-incremental-backup-pg-basebackup-pg-combinebackup/ |
This file contains 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
# Docker | |
docker run --rm -it --network="host" --add-host host.docker.internal:host-gateway dimitri/pgloader:latest pgloader --verbose --debug --client-min-messages debug --log-min-messages debug mysql://<user>:<password>@127.0.0.1:3306/dbname postgresql://<user>:<password>@127.0.0.1:5432/dbname | |
# Brew | |
# @see: https://github.com/dimitri/pgloader/issues/962 | |
brew install pgloader | |
pgloader --verbose --debug --client-min-messages debug --log-min-messages debug --dynamic-space-size 262144 -v pgloader.load | |
# Config (pgloader.load) | |
LOAD DATABASE |
This file contains 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
Disable the firewall: | |
/usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off | |
Remove the firewall config (**doesn't work due to permissions**): | |
sudo rm /usr/libexec/ApplicationFirewall/com.apple.alf.plist | |
Or, backup the firewall config (**doesn't work due to permissions**): | |
sudo mv /usr/libexec/ApplicationFirewall/com.apple.alf.plist /usr/libexec/ApplicationFirewall/com.apple.alf.plist.bak | |
Enable the firewall: |
This file contains 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
// Inspired by Twitter Unfollow All: https://gist.github.com/ziadoz/caa882e75c11be9e8064e570ffec1f5f | |
(() => { | |
const $bookmarkButtons = 'button.status__action-bar__button.bookmark-icon'; | |
const retry = { | |
count: 0, | |
limit: 3, | |
}; |
This file contains 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 | |
$url = 'http://maps.googleapis.com/maps/api/staticmap?'; | |
$bits = array( | |
'center' => 'Calgary Tower, Calgary, AB, Canada', | |
'zoom' => '16', | |
'size' => '800x600', | |
'maptype' => 'roadmap', | |
'markers' => 'color:0x576d4e|label:N|49.6967179,-112.8450119', | |
'sensor' => 'false', | |
); |
This file contains 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 | |
// See Error Handling in PHP: https://nomadphp.com/2015/02/25/nomadphp-2015-02-us-lt2/# | |
$display = function ($status, $headers = array(), $content = '') { | |
http_response_code($status); | |
foreach ($headers as $key => $value) { | |
header($key . ': ' . $value); | |
} |
This file contains 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
/** | |
* Array Looping | |
*/ | |
const arr = ['foo']; | |
// A for...in loop will return the key... | |
// @see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in | |
for (const key in arr) { | |
console.log(key); | |
} |
This file contains 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 | |
$attr3 = 'baz'; | |
$attr4 = 99_999; | |
$attr5 = new stdClass; | |
$attrWtf = 'wtf'; | |
@endphp | |
<x-my-component | |
attr1="foo" {{-- Component receives string --}} | |
attr2="{{ 'bar' }}" {{-- Component receives string --}} |
This file contains 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 | |
// @see: https://docs.pydantic.dev/latest/concepts/pydantic_settings/#usage | |
final readonly class DatabaseConfig | |
{ | |
#[Concat( | |
#[Env('DB_HOST')], | |
#[Str('://')], | |
#[Env('DB_USER')], | |
#[Str('@')], |
This file contains 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 | |
/* | |
Contextual attributes were implementated by @innocenzi and @ollieread: | |
- https://github.com/laravel/framework/pull/51934 | |
- https://github.com/laravel/framework/pull/52428 | |
I added contextual attributes for the core drivers: | |
- https://github.com/laravel/framework/pull/52265 |
NewerOlder