This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
$$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
$$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2012, Dusty Burwell | |
// | |
// ==UserScript== | |
// @name Emoticons for YouTrack | |
// @namespace http://dustyburwell.github.com | |
// @description Converts text to emoticons in YouTrack. | |
// @include http://youtrack/* | |
// @include https://youtrack/* | |
// ==/UserScript== |