Skip to content

Instantly share code, notes, and snippets.

View mikoscz's full-sized avatar
👋

Michał Staśkiewicz mikoscz

👋
View GitHub Profile
@subfuzion
subfuzion / curl.md
Last active November 19, 2024 16:32
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.

@tannerlinsley
tannerlinsley / onWindowFocus.ts
Last active January 30, 2024 09:37
A utility function to detect window focusing without false positives from iframe focus events
type State = {
added: boolean;
interval: false | ReturnType<typeof setInterval>;
inFrame: boolean;
callbacks: Array<SetFocusedCallback>;
};
type EnrichedHTMLIFrameElement = HTMLIFrameElement & { ___onWindowFocusHandled: boolean };
type SetFocusedCallback = (focused?: boolean) => void;
@rinogo
rinogo / job.service.spec.ts
Last active May 20, 2024 17:09
Integration Testing a NestJS Service that leverages Prisma
import { Test, TestingModule } from '@nestjs/testing';
import { PrismaService } from '../prisma.service';
import { JobService } from './job.service';
import * as crypto from 'crypto';
describe('JobService', () => {
let service: JobService;
let prisma: PrismaService;
beforeEach(async () => {
@rphlmr
rphlmr / clear-db.ts
Last active November 14, 2024 18:53
Drizzle snippets
// Credits to Louistiti from Drizzle Discord: https://discord.com/channels/1043890932593987624/1130802621750448160/1143083373535973406
import { sql } from "drizzle-orm";
const clearDb = async (): Promise<void> => {
const query = sql<string>`SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'
AND table_type = 'BASE TABLE';
`;
@kconner
kconner / macOS Internals.md
Last active November 13, 2024 07:51
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@jleem99
jleem99 / README.md
Last active September 27, 2024 11:32
Bash script that enables Metal API for League of Legends on macOS

Bash script that enables Metal API for League of Legends on macOS.

After installing League of Legends, you can run this script to enable Metal API for the game.
You can expect a performance boost of up to ~2x FPS.

How to run

To run the script, download the script and run it in Terminal.
Or, open Terminal and type the following command: