Skip to content

Instantly share code, notes, and snippets.

@kaznak
kaznak / postgres-cheatsheet.md
Created May 23, 2024 23:26 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
title: OpenAPI Document tools
tools:
- name: OpenAPI-Specification
official: https://www.openapis.org/
source: https://github.com/OAI/OpenAPI-Specification
tag:
- document
openapi-versions:
stable:
@kaznak
kaznak / distributed_service_catalog.md
Created October 1, 2023 23:36 — forked from nagiept/distributed_service_catalog.md
Distributed Service Catalog 2018

Distributed Service Catalog 2018

分散SNS Advent Calendar 2018 Fediverseとその他の分散サービスの歴史とプロジェクトを適当に書いておくだけの記事

Progects list

Laconica

ジャンル マイクロブログ
読み ラコニカ(?)
開発者 Evan Prodromou(Control Yourself社)
言語 PHP
# MIT License
from transformers import AutoTokenizer
import transformers
from langchain.document_loaders import PyPDFLoader
import torch
model = "NousResearch/Yarn-Llama-2-13b-128k"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
[alias]
# graph = !"git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'"
graph = !"git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'"
permission-reset = !git diff -p -R --no-ext-diff --no-color | grep -E \"^(diff|(old|new) mode)\" --color=never | git apply
@kaznak
kaznak / 55-bytes-of-css.md
Created September 26, 2022 00:29 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@kaznak
kaznak / wordle-answers-alphabetical.txt
Created February 8, 2022 12:10 — forked from cfreshman/wordle-answers-alphabetical.txt
Wordle answers from source code in alphabetical order. And if you write a solver, here's a leaderboard! https://freshman.dev/wordle/#/leaderboard
aback
abase
abate
abbey
abbot
abhor
abide
abled
abode
abort

Create a new project

poetry new <project-name>

Add a new lib

potry add <library>

Remove a lib

@kaznak
kaznak / webrtc_for_work.rst
Created August 23, 2020 14:41 — forked from voluntas/webrtc_for_work.rst
仕事で WebRTC
@kaznak
kaznak / configuration.nix
Last active December 14, 2023 08:01
NixOS configuration for AWS EC2 instance
{ modulesPath, pkgs, lib, ... }: {
imports = [
"${modulesPath}/virtualisation/amazon-image.nix"
];
ec2.hvm = true;
################################################
system.autoUpgrade = {
enable = true;
allowReboot = true;