Skip to content

Instantly share code, notes, and snippets.

View rvkulikov's full-sized avatar
💭
А в душе май

Roman Kulikov rvkulikov

💭
А в душе май
  • Moscow, Russia
  • 05:24 (UTC +03:00)
View GitHub Profile
function getPathWithKey(path, key) {
return typeof path === 'string' ? `${path}[${key}]` : key;
}
/**
* Esta função converte um objeto plano com chaves aninhadas para
* o formato esperado pelo URLSearchParams, que é utilizado nas requisições
* que exige o "Content-Type": "application/x-www-form-urlencoded".
*
* Um objeto com estrutura
@briandignan
briandignan / save_restore_dependencies.sql
Last active November 13, 2025 07:29 — forked from claudep/save_restore_dependencies.sql
Changed types for compatibility with PG12. Added save/restore for indexes/rules
create table if not exists deps_saved_ddl
(
deps_id serial primary key,
deps_view_schema name,
deps_view_name name,
deps_ddl_to_run text
);
create or replace function deps_save_and_drop_dependencies(p_view_schema name, p_view_name name) returns void as
$$
@Krever
Krever / _README.md
Last active May 25, 2025 17:00
Yabai setup for i3wm users
@Delivator
Delivator / lockmicvolume.ps1
Created February 7, 2019 21:13
A little powershell script that sets the default microphone volume to a set value, requires nircmd.exe to be in same directory as the script
# How long it should wait between every loop in seconds
$secondsToWait = 5
# The volume you want in percent (0.92 = 92%)
$volume = 1.00
Write-Host "Starting invinite loop, press CTRL + C or close the window to stop"
while (1) {
Start-Process -FilePath "nircmd.exe" -WorkingDirectory $PSScriptRoot -ArgumentList "setsysvolume $([math]::floor(65535 * $volume))","default_record" -Wait
Write-Host "Volume set to $($volume * 100)%"
Start-Sleep -Seconds $secondsToWait
@anvk
anvk / psql_useful_stat_queries.sql
Last active June 1, 2025 16:17
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@lkraider
lkraider / gs-resample.sh
Created March 7, 2017 20:06
Ghostscript PDF quality downsample
#!/bin/sh
# It seems it's very hard to set resample output quality with Ghostscript.
# So instead rely on `prepress` preset parameter to select a good /QFactor
# and override the options we don't want from there.
gs \
-o resampled.pdf \
-sDEVICE=pdfwrite \
-dPDFSETTINGS=/prepress \
#!/usr/bin/env python
import i3
outputs = i3.get_outputs()
workspaces = i3.get_workspaces()
# figure out what is on, and what is currently on your screen.
workspace = list(filter(lambda s: s['focused']==True, workspaces))
output = list(filter(lambda s: s['active']==True, outputs))
@mateuszwenus
mateuszwenus / save_restore_dependencies.sql
Last active November 13, 2025 07:30
PostgreSQL: How to handle table and view dependencies
create table deps_saved_ddl
(
deps_id serial primary key,
deps_view_schema varchar(255),
deps_view_name varchar(255),
deps_ddl_to_run text
);
create or replace function deps_save_and_drop_dependencies(p_view_schema varchar, p_view_name varchar) returns void as
$$
@kidpixo
kidpixo / PostGIS 2.0 Cheatsheet.md
Last active September 2, 2025 09:49
PostGIS 2.0 Cheatsheet
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active December 5, 2025 09:56
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'