Skip to content

Instantly share code, notes, and snippets.

@insytes
insytes / index.ts
Created January 25, 2024 15:36
Typescript options object helper
// helper type
type RequiredProps<T, K extends keyof T> = Partial<T> & Required<Pick<T, K>>
type Person = {
id: string
name: string
formatted_name: string
age: number
}
@insytes
insytes / react_redis_pubsub.php
Created June 6, 2018 14:28
ReactPHP Redis Pub/Sub
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
ini_set("default_socket_timeout", 10);
require __DIR__ . "/../../vendor/autoload.php";
$loop = React\EventLoop\Factory::create();
$factory = new Factory($loop);
@insytes
insytes / mysqldump-ignore-multiple-tables
Created December 14, 2016 01:30
mysqldump ignore multiple tables
mysqldump -u root -p database --ignore-table=database.table1 --ignore-table=database.table2 > dump.sql
@insytes
insytes / mysqldump-where
Last active December 10, 2018 00:01
mysqldump with complete inserts including column definitions and a WHERE clause
mysqldump -u root -p database table --no-create-info --skip-extended-insert --complete-insert --where="active = 1" > dump.sql