Skip to content

Instantly share code, notes, and snippets.


Piotr Monwid-Olechnowicz hasparus

View GitHub Profile
hasparus / Microsoft.Powershell_profile.ps1
Last active Jun 23, 2021
A guide on setting up on new laptops for future me, and a manifest of all the tools I installed.
View Microsoft.Powershell_profile.ps1
# Git Completions
Import-Module posh-git
# Prompt
Invoke-Expression (&starship init powershell)
# Aliases
Set-Alias g git
Set-Alias y yarn
View going-too-far-with-matchers-type.ts
// TypeScript Playground:
/// <reference types="@types/jest" />
import type { MatcherState } from 'expect';
const matchers = {
toHaveWordsCount(this: MatcherState, sentence: string, wordsCount: number) {
// implementation redacted
View examples-auth-db.tsx
// Imagine that @prisma/client is a normal library and it doesn't have different types in userspace and libraries
import {GetEvents, LogDefinition, LogLevel, PrismaClient, PrismaClientOptions} from "@prisma/client"
import {exec} from "child_process"
interface EnhancedPrismaClient<
// TypeScript doesn't have higher (i.e. * -> * -> *) order types, so
// we can't use anything like ConstructorParameters<typeof PrismaClient>,
// because ConstructorParameter will "strip" generics.
// The only way to preserve generic parameters is to copy them.
View collectGraphQLFragments.ts
// @ts-ignore
import GatsbyParser from "gatsby/dist/query/file-parser";
import path from "path";
import glob from "glob";
* Collect all graphql fragments from a directory
* @see
export const collectGraphQLFragments = async (
hasparus / print-readme.yml
Created Jul 7, 2020
Print GitHub readme to PDF with Pandoc
View print-readme.yml
name: Print readme to PDF
paths: ['', '.github/workflows/print-readme.yml']
runs-on: ubuntu-18.04
hasparus / lazy-avatar-nextjs.ts
Created Mar 30, 2020
avatar = facebook || tinygraphs
View lazy-avatar-nextjs.ts
import { NextApiResponse, NextApiRequest } from "next";
import fetch from "isomorphic-unfetch";
export default async function avatar(
req: NextApiRequest,
res: NextApiResponse
) {
const {
query: { username_slug },
} = req;
View cloudSettings
hasparus /
Last active Jun 29, 2020
A color scheme for Windows Terminal

👨‍🎤 Cyberpunk SCARLET for Windows Terminal

screenshot of terminal presenting colors and borg cowsay saying "Hello!"

profile settings in screenshot

  "colorScheme": "Cyberpunk SCARLET",
  "cursorHeight": 25,
  "cursorShape": "vintage",
hasparus /
Last active Feb 11, 2020
talk idea for the February Wrocław TypeScript meetup

Title: Case Study: Helping with TypeScript problems of react-three-fiber.

Dan Questions:

  • How will you deliver the idea to the audience?

    • R3F is pretty rad. Gonna show this on the first slide.
  • What is the one thing that you want people to take away from your talk?

    • Compiler API is powerful. We can use this power to hard solve problems.