Skip to content

Instantly share code, notes, and snippets.

@Bobach22
Bobach22 / PostgreSqlPlatform.php
Created April 25, 2024 10:54 — forked from dextervip/PostgreSqlPlatform.php
Symfony Doctrine support for timescaledb
<?php
namespace App\Domain\Doctrine\DBAL\Platforms;
use Doctrine\DBAL\Platforms\PostgreSQL100Platform as PostgreSqlPlatformBase;
class PostgreSqlPlatform extends PostgreSqlPlatformBase
{
@Bobach22
Bobach22 / just_use_fkeys.sql
Created November 20, 2022 20:10 — forked from troyk/just_use_fkeys.sql
Polymorphic relationships with triggers in postgresql
-- saving here for later reference incase I decide to complicate things, decided to just use foreign keys
create table user_groups {
id bigint PRIMARY KEY default id_generator(),
account_id bigint not null references accounts(id) on delete cascade on update cascade,
updated_at timestamptz,
name citext not null
}
CREATE TYPE notification_level AS ENUM ('change', 'complete', 'digest', 'all');
@Bobach22
Bobach22 / api_backends.conf
Created March 19, 2022 22:06 — forked from nginx-gists/api_backends.conf
Deploying NGINX Plus as an API Gateway, Part 1
upstream warehouse_inventory {
zone inventory_service 64k;
server 10.0.0.1:80;
server 10.0.0.2:80;
server 10.0.0.3:80;
}
upstream warehouse_pricing {
zone pricing_service 64k;
server 10.0.0.7:80;
Route::get('redis', array('as' => 'cache', 'do' => function()
{
$redis = Redis::connection();
//STRING
$redis->set('name', 'Taylor');
$name = $redis->get('name');
// LIST
// A list is a series of ordered values. Some of the important commands for interacting with lists are RPUSH, LPUSH, LLEN, LRANGE, LPOP, and RPOP.