Skip to content

Instantly share code, notes, and snippets.

View prettyirrelevant's full-sized avatar
💭
???

Isaac Adewumi prettyirrelevant

💭
???
View GitHub Profile
@ixahmedxi
ixahmedxi / settings.json
Created January 2, 2024 20:45
VSCode settings.json
{
// open json editor for settings
"workbench.settings.editor": "json",
// Theme
"workbench.colorTheme": "Aura Dark",
"workbench.iconTheme": "moxer-icons",
// Change font
"editor.fontFamily": "Geist Mono",
@ixahmedxi
ixahmedxi / settings.json
Created January 2, 2024 08:05
My settings.json
{
"workbench.startupEditor": "none",
"workbench.iconTheme": "moxer-icons",
"workbench.colorTheme": "Aura Dark",
"workbench.settings.editor": "json",
"breadcrumbs.enabled": false,
"explorer.compactFolders": false,
"editor.wordWrap": "bounded",
"editor.tabSize": 2,
"editor.inlineSuggest.enabled": true,
@rsaryev
rsaryev / prisma-utils.ts
Last active May 28, 2024 11:27
Prisma analogue migrate rest command only programmatically, for testing purposes.
import { Prisma, PrismaClient } from '@prisma/client';
import { exec } from 'child_process';
import * as util from 'util';
const execPromisify = util.promisify(exec);
const prisma = new PrismaClient();
const tables = Prisma.dmmf.datamodel.models
.map((model) => model.dbName)
.filter((table) => table);
@prettyirrelevant
prettyirrelevant / app.py
Last active December 6, 2024 02:55
Using Huey with Flask using application factory. For configuration, follow the djhuey format
# Due to the flexible nature of Flask. This might be __init__.py
from .extensions import huey
def create_app():
app = Flask(__name__)
# add your configurations
# app.config.from_object("settings.local")
huey.init_app(app)
@thibaud-opal
thibaud-opal / console.py
Last active November 26, 2022 11:47
Using typer with classes as commands
#!/usr/bin/env python3
from my_commands import PrintCommand
from my_lib import PrinterDriver
import os
import typer
app = typer.Typer()
myPrinter = PrinterDriver()
commands = {
@azagniotov
azagniotov / beautiful.rest.api.docs.in.markdown.md
Last active March 20, 2025 07:28
Example to create beautiful REST API docs in Markdown, inspired by Swagger API docs.
@prettyirrelevant
prettyirrelevant / logger.ts
Created March 18, 2021 01:23
Express JS Logging Boilerplate
import morgan, { StreamOptions } from "morgan";
import winston from "winston";
const levels = {
error: 0,
warn: 1,
info: 2,
debug: 3,
};
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 8, 2025 14:18
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;
}
@rylev
rylev / learn.md
Created March 5, 2019 10:50
How to Learn Rust

Learning Rust

The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.

Warning

Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.

The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.

@subfuzion
subfuzion / curl.md
Last active March 31, 2025 16:15
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.