Skip to content

Instantly share code, notes, and snippets.

@unnoq
unnoq / mysql-statements.md
Last active March 28, 2022 07:10
Mysql statements

Common mysql statements

Create and gain permissions

    CREATE DATABASE `nicker`;
    CREATE USER 'nicker'@'%' IDENTIFIED BY 'P@ssw0rd';
    GRANT ALL PRIVILEGES ON `nicker`.* TO 'nicker'@'%';
@unnoq
unnoq / [laravel] infection.json
Last active June 25, 2022 03:50
infection/infection
{
"source": {
"directories": ["app"],
"excludes": [
"Actions/Fortify",
"Actions/Jetstream",
"Console/Kernel.php",
"Exceptions",
"Http/Middleware",
"Http/Kernel.php",
@unnoq
unnoq / [laravel] .php-cs-fixer.php
Last active June 25, 2022 03:54
friendsofphp/php-cs-fixer
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'@PHPUnit84Migration:risky' => true,
'@PHP80Migration:risky' => true,
'@PHP81Migration' => true,
@unnoq
unnoq / [laravel] phpstan.neon
Last active August 19, 2022 13:12
phpstan/phpstan
includes:
- ./vendor/nunomaduro/larastan/extension.neon
parameters:
reportUnmatchedIgnoredErrors: false
paths:
- app
@unnoq
unnoq / xdebug.ini
Created November 21, 2022 08:44
php
zend_extension=xdebug.so
xdebug.mode = debug,develop,coverage
xdebug.start_with_request = yes
xdebug.log = /tmp/xdebug.log
@unnoq
unnoq / tsconfig.base.json
Last active July 6, 2023 14:20
typescript
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
@unnoq
unnoq / extend.ts
Last active October 4, 2023 09:28
trpc-simulation
import { z } from 'zod';
type Innput<TShape extends z.Schema> = {
innput: TShape;
config: any;
};
type Fnn<TShape extends z.Schema> = (input: z.infer<TShape>) => void;
const fn: <TShape extends z.Schema, TFn extends Fnn<TShape>>(
@unnoq
unnoq / batch.sql
Created October 13, 2023 03:59
postgresql
DO $$
DECLARE
counter integer := 1;
batch_size integer := 100;
BEGIN
WHILE counter <= 10000 LOOP
-- Use the counter to generate unique table names
EXECUTE 'CREATE TABLE IF NOT EXISTS "customer_histories_' || counter || '" PARTITION OF "customer_histories" FOR VALUES WITH (MODULUS 10000, REMAINDER ' || (counter - 1)::int || ');';
counter := counter + 1;
@unnoq
unnoq / globals.css
Last active March 22, 2024 08:10
untitled-ui
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
:root {
--color-ring-brand: 158 119 237;
--color-ring-gray: 158 162 179;
--color-ring-gray-secondary: 158 162 179;
--color-ring-error: 240 68 56;
{
"files.associations": {
"*.css": "tailwindcss"
},
"tailwindCSS.classAttributes": [".*Variants", ".*Variants: .*"],
"tailwindCSS.experimental.classRegex": [
"'([^'\\n]*)'[,)\\]]",
"\"([^\"\\n]*)\"[,)\\]]",
"`([^`]*)`[,)\\]]",