Skip to content

Instantly share code, notes, and snippets.

View HristoKolev's full-sized avatar
🎯
Focusing

Hristo Kolev HristoKolev

🎯
Focusing
View GitHub Profile

Configuring git to use SSH (a little misleading calling it gpg.format) for signing commits:

git config --global gpg.format ssh

Configuring git to sign commits with your SSH key:

git config --global user.signingkey $env:USERPROFILE\.ssh\id_ed25519.pub

git config --global gpg.ssh.allowedSignersFile $env:USERPROFILE\.ssh\allowed_signers

By default the ssh-agent service is disabled. Configure it to start automatically.

Get-Service ssh-agent | Set-Service -StartupType Automatic

To start the ssh-agent service:

Start-Service ssh-agent

To stop the ssh-agent service:

/api/bla:
get:
operationId: some_operation
parameters:
- name: param_name
required: true
in: query
schema:
$ref: '#/components/schemas/SomeModel'
content:
@HristoKolev
HristoKolev / Container ENV variable passthrough to JS Frontend
Created November 14, 2024 12:31
Container ENV variable passthrough to JS Frontend
echo "window.process.env = `jq env -n | jq 'with_entries(select(.key | startswith("REACT_APP_")))'`;" > env.js
ALTER TABLE "users" ALTER COLUMN "users_id" DROP IDENTITY IF EXISTS;
CREATE SEQUENCE IF NOT EXISTS "users_users_id_seq" AS integer;
ALTER TABLE "users" ALTER COLUMN "users_id" SET DEFAULT nextval('"users_users_id_seq"'::regclass);
ALTER SEQUENCE "users_users_id_seq" OWNED BY "users"."users_id";
SELECT setval('"users_users_id_seq"', (SELECT MAX("users_id") FROM "users"));
ALTER TABLE "sessions" ALTER COLUMN "sessions_id" DROP IDENTITY IF EXISTS;
CREATE SEQUENCE IF NOT EXISTS "sessions_sessions_id_seq" AS integer;
ALTER TABLE "sessions" ALTER COLUMN "sessions_id" SET DEFAULT nextval('"sessions_sessions_id_seq"'::regclass);
ALTER SEQUENCE "sessions_sessions_id_seq" OWNED BY "sessions"."sessions_id";
@HristoKolev
HristoKolev / postgresql-constraints.sql
Created February 29, 2024 10:31
postgressql constraints fix
-- select all duplicate layouts
with agg as (SELECT name, type, owner FROM layouts GROUP BY name, type, owner HAVING COUNT(*) > 1)
SELECT
l.*
FROM agg
JOIN layouts l ON l.name = agg.name AND l.type = agg.type AND l.owner = agg.owner;
-- select all duplicate prefs
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"globals": {},
"ignorePatterns": [
"package-lock.json",
"/dist/",
import { addReducers } from '../store';
addReducers({
account: accountReducer
});
declare module '../store' {
interface IReduxState {
account: IAccountState;
}
declare module '../store' {
interface IReduxState {
account: IAccountState;
}
}