Skip to content

Instantly share code, notes, and snippets.

View sappChak's full-sized avatar
💥
Focusing

Andrii Konotop sappChak

💥
Focusing
  • Slovakia
View GitHub Profile
@Jubiko31
Jubiko31 / db.rs
Created July 24, 2023 13:04
🦀 Rust (Rocket) microservice to clean up postgres database within specified interval. Connection to Django app with RabbitMQ
use tokio_postgres::{NoTls, Error};
pub async fn pg_delete_old_records() -> Result<(), Error> {
let (client, connection) = tokio_postgres::connect("postgres://postgres:postgres@localhost:5432/test_db", NoTls).await?;
tokio::spawn(async move {
if let Err(e) = connection.await {
eprintln!("connection error: {}", e);
}
});
@kooooohe
kooooohe / Clean-Architecture-with-InversifyJS.ts
Last active February 13, 2024 23:31
Clean Architecture with InversifyJS
import { firestore } from 'firebase'
import { injectable, inject, Container } from 'inversify'
import { db } from '@/plugins/firebase'
import 'reflect-metadata'
class RestaurantDataModel {
constructor(init: any) {
this.id = init.id || this.id
this.clientUID = init.clientUID || this.clientUID
this.content = init.content || this.content
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a