Skip to content

Instantly share code, notes, and snippets.

View AlexRogalskiy's full-sized avatar
🛰️
Work on stuff that matters

Alexander AlexRogalskiy

🛰️
Work on stuff that matters
View GitHub Profile
@AlexRogalskiy
AlexRogalskiy / types_and_roles_demo.sql
Created March 19, 2024 16:08 — forked from levlaz/types_and_roles_demo.sql
Create Types and Roles If Not Exist in PostgreSQL
BEGIN;
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'task_status') THEN
create type task_status AS ENUM ('todo', 'doing', 'blocked', 'done');
END IF;
END
$$;
CREATE TABLE IF NOT EXISTS
@AlexRogalskiy
AlexRogalskiy / api.mustache
Created January 30, 2024 15:47 — forked from erohana/api.mustache
openapi spring webflux server code generator
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package {{package}};
{{#imports}}import {{import}};
{{/imports}}
import io.swagger.annotations.*;
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@AlexRogalskiy
AlexRogalskiy / LenientFutureCollector.java
Created January 15, 2024 17:34 — forked from dhet/LenientFutureCollector.java
Wait for the completion of multiple Java Futures or time out
import java.time.Duration;
import java.time.Instant;
import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.function.*;
import java.util.stream.Collector;
@AlexRogalskiy
AlexRogalskiy / GatewayApplication.java
Created January 5, 2024 00:57 — forked from WeirdBob/GatewayApplication.java
Spring cloud gateway response body modification
package examples;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@EnableAutoConfiguration
public class GatewayApplication {
@AlexRogalskiy
AlexRogalskiy / Dockerfile
Created December 13, 2023 14:58 — forked from Slach/Dockerfile
clickhouse with odbc, for docker-compose and kubernetes
FROM yandex/clickhouse-server:${CLICKHOUSE_VERSION:-latest}
USER root
ARG UBUNTU_NAME=focal
ARG UBUNTU_VERSION=20.04
RUN echo "Begin ODBC install" && \
#MySQL repo
wget -qO- "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xa4a9406876fcbd3c456770c88c718d3b5072e1f5" | apt-key add - && \
echo "deb http://repo.mysql.com/apt/ubuntu/ ${UBUNTU_NAME} mysql-8.0" >/etc/apt/sources.list.d/mysql-oracle.list && \
@AlexRogalskiy
AlexRogalskiy / upstream.md
Created December 11, 2023 07:44 — forked from hackjutsu/upstream.md
[set upstream] What does '--set-upstream' do? #tags: git
git branch --set-upstream-to <remote-branch>
# example
git branch --set-upstream-to origin feature-branch

# show up which remote branch a local branch is tracking
git branch -vv

sets the default remote branch for the current local branch.

Intro

Normally the Jetbrains applications store their config and system in a directory in your home directory. That's fine except when you run out of space in your home directory, or they change the directory with an upgrade. For example, when you upgrade PhpStorm from 2016.3 to 2017.1, the config directory and systems directory changes as well. This means that 2017.1 doesn't have the plugins you installed with 2016.3

Somewhere buried deep in the knowledge base is an article that explains how you can fix this but putting it out here makes it easier to find.

Instructions

These instructions are written for Ubuntu, if you run another distro the locations and files might be different.

I'm assuming you config and system directory will be stored in /d1/config/{JetBrains App}/

layout title description tags
default
SQL Style Guide
A guide to writing clean, clear, and consistent SQL.
data
process

Purpose

layout title description tags
default
SQL Style Guide
A guide to writing clean, clear, and consistent SQL.
data
process

Purpose