Skip to content

Instantly share code, notes, and snippets.

View raikusy's full-sized avatar
:electron:
Reacting 🌸

Rakibul Hasan raikusy

:electron:
Reacting 🌸
View GitHub Profile
@chimame
chimame / context.ts
Created March 17, 2024 11:53
Automatic rollback of vitest using drizzle
import { Client } from "pg";
import { drizzle } from "drizzle-orm/node-postgres";
import * as schema from "../drizzle/schema";
import { Logger } from "drizzle-orm/logger";
export async function createContext() {
const client = new Client({
connectionString: "your database connection string",
});
await client.connect();
@rphlmr
rphlmr / helpers.ts
Last active February 25, 2025 15:58
Drizzle ORM, deep sub queries
/* -------------------------------------------------------------------------- */
/* More here; */
/* -------------------------------------------------------------------------- */
// https://gist.github.com/rphlmr/0d1722a794ed5a16da0fdf6652902b15
export function distinctOn<Column extends AnyColumn>(column: Column) {
return sql<Column["_"]["data"]>`distinct on (${column}) ${column}`;
}
export function jsonBuildObject<T extends SelectedFields>(shape: T) {
@sjsakib
sjsakib / README.md
Last active February 6, 2020 21:59
This script gets a random featured image from unsplash.com and sets it as your desktop background. Works on `gsettings` supported linux distros. Tested on Ubuntu 19.10 (Gnome). Requires the `requests` module to be installed. It takes some time to download the photo. So, wait patiently after executing the script. You can use `anacrontab` to run i…

This script gets a random featured image from unsplash.com and sets it as your desktop background. Works on gsettings supported linux distros. Tested on Ubuntu 19.10 (Gnome). Requires the requests module to be installed.

It takes some time to download the photo. So, wait patiently after executing the script.

You can use anacrontab to run it daily or weekly. See http://bit.ly/371ybhq

@jpswade
jpswade / devops_best_practices.md
Last active December 8, 2025 09:02
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, at the Agile Conference in Toronto, Andrew Shafer posted an offer to moderate an ad hoc "Birds of a Feather" meeting to discuss the topic of "Agile Infrastructure". Only one person showed up to discuss the topic: Patrick Debois. Their discussions and sharing of ideas with others advanced the concept of "agile systems administration". Debois and Shafer formed an Agile Systems Administrator group on Google, with limited success. Patrick Debois did a presentation called "Infrastructure and Operations" addressing