Skip to content

Instantly share code, notes, and snippets.

@cayter
cayter / repository.ts
Last active April 19, 2024 11:27
Drizzle ORM Type-Safe Repository With PgTable
import { startSpan } from "@sentry/remix";
import type { StartSpanOptions } from "@sentry/types";
import {
type AnyColumn,
type AnyTable,
type BuildQueryResult,
type DBQueryConfig,
type DrizzleTypeError,
type Equal,
type ExtractTablesWithRelations,
@davidhooey
davidhooey / oracle_wait_events_for_sqlid.sql
Created September 17, 2013 13:58
Oracle Wait Events for SQL_ID
-- Shared Pool
select
event,
time_waited "time_waited(s)",
case when time_waited = 0 then
0
else
round(time_waited*100 / sum(time_waited) Over(), 2)
end "percentage"
from
@WillianTomaz
WillianTomaz / wsl-info.md
Last active April 19, 2024 11:26
Instruções do WSL (Instalação, Backup e Restauração)

Instruções para Instalação, Backup e Restauração do WSL 2

  • Observação:

    • Sempre buscar pela documentação oficial, este documento é um tutorial
      que pode não te atender conforme tenha novas atualizações do processo de instalação.
    • As referências estão no final do documento.
  • Foi utilizado:

    • Windows 10
@igv
igv / adaptive-sharpen.glsl
Last active April 19, 2024 11:26
Optimal sharpening strength (according to objective metrics) - 0.5. Can be applied only to luma channel (change OUTPUT to LUMA). To use it on-demand add the following line to input.conf: n change-list glsl-shaders toggle "~~/adaptive-sharpen.glsl"
// Copyright (c) 2015-2021, bacondither
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer
// in this position and unchanged.
// 2. Redistributions in binary form must reproduce the above copyright
@igv
igv / SSimSuperRes.glsl
Last active April 19, 2024 11:26
Basically it's an accurate sharpener + antiringing. Usage: glsl-shader="~~/SSimSuperRes.glsl"
// SSimSuperRes by Shiandow
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3.0 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@igv
igv / SSimDownscaler.glsl
Last active April 19, 2024 11:26
Tuned for linear-downscaling=no.
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3.0 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
@taoyuan
taoyuan / generate_self_signed_certification.md
Last active April 19, 2024 11:23
Generation of a Self Signed Certificate

Generation of a Self Signed Certificate

Generation of a self-signed SSL certificate involves a simple 3-step procedure:

STEP 1: Create the server private key

openssl genrsa -out cert.key 2048

STEP 2: Create the certificate signing request (CSR)

openssl req -new -key cert.key -out cert.csr
@smilz0
smilz0 / L4B.nut
Created June 28, 2023 08:25
Left 4 Bots Settings
// [1/0] 1 = Prevents (at least will try) the infamous bug of the pipe bomb thrown right before transitioning to the next chapter that makes the bots bug out and do nothing for the entire next chapter. 0 = Disabled
anti_pipebomb_bug = 1
// Chance that the bot will chat one of the BG lines at the end of the campaign (if dead or incapped)
bg_chance = 50
// Last bot entering the saferoom will close the door after this delay (if close_saferoom_door is 1). You can increase/decrease this value for maps with CHECKPOINT nav areas not perfectly aligned to the door
close_saferoom_delay = 0.9
// [1/0] Enable/Disable closing the door right after entering the saferoom
@Atem18
Atem18 / gist:4696071
Last active April 19, 2024 11:18 — forked from evildmp/gist:3094281
Tutorial to seting up a django website in production.

******************************************************************** Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor********************************************************************

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
@etoosamoe
etoosamoe / docker-volume-transfer.md
Created April 6, 2023 08:39
How to transfer Docker Volumes to another host

Goal

You have docker volume on one host and want to move that volume to another host. For example, you want to transfer PostgreSQL container with it's volume to another host.

Solution

Actually, there is no in-a-box solution from Docker, so we need to:

  • attach our volume to another container
  • copy and archive all files
  • copy archive to another host