Skip to content

Instantly share code, notes, and snippets.

View acro5piano's full-sized avatar
🏠
Working from home

Kay Gosho acro5piano

🏠
Working from home
View GitHub Profile
/* File generated automatically, do not edit. */
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
export type DBEventType =
'goal' |
'own-goal' |
'penalty-goal' |
'penalty-miss' |
'yellow-card' |
@acro5piano
acro5piano / readme.md
Last active August 30, 2024 15:27
Arch linux full system upgrade without bluez

Newer bluez is buggy. It makes CPU usage 100% randomly.

5.72 is working fine. Let's keep using it.

sudo pacman -U /var/cache/pacman/pkg/bluez*5.72-2-x86_64.pkg.tar.zst

I need to ignore upgrading bluez until a stable version is released. To do so,

@ashbuilds
ashbuilds / server.ts
Last active May 30, 2024 14:38
Implementing GraphQL Subscriptions with Websockets in a Bun Server using graphql-yoga
import Bun from 'bun'
import { createYoga, YogaInitialContext, YogaServerInstance } from 'graphql-yoga'
import { makeHandler } from "graphql-ws/lib/use/bun";
import { ExecutionArgs } from "@envelop/types";
import { schema } from './graphql/schema';
interface IUserContext {
token?: string;
}
@buzztaiki
buzztaiki / rust-evdev-uinput-example.md
Last active July 21, 2023 13:25
Rust で evdev と uinput を使ってキーマッパーっぽい事をするメモ
@petrilli
petrilli / main.py
Last active October 10, 2024 13:40
Example combination of FastAPI and Pydantic with aiosql and aiosqlite
# -*- coding: utf-8 -*-
"""Example combination of FastAPI and Pydantic with aiosql and aiosqlite.
This module demonstrates the minimum viable integration approach for putting
together a few components:
- FastAPI. This provides a very high-performance and type-driving approach to
building APIs in Python
- Pydantic. A powerful data validation library.
- aiosql. Inspired by annosql and originally Clojure's yeSql, a way to programatically,
@rnyrnyrny
rnyrnyrny / alacritty.yml
Created May 20, 2021 03:42
my alacritty config file for win10 wsl2
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Import additional configuration files
#
# Imports are loaded in order, skipping all missing files, with the importing
# file being loaded last. If a field is already present in a previous import, it
# will be replaced.
#
# All imports must either be absolute paths starting with `/`, or paths relative
# to the user's home directory starting with `~/`.

Keybase proof

I hereby claim:

  • I am Rudo2204 on github.
  • I am rudo2204 (https://keybase.io/rudo2204) on keybase.
  • I have a public key whose fingerprint is 4E50 E916 5AF3 72D5 F8E4 89B8 8F1B 9F11 8267 E3A1

To claim this, I am signing this object:

@iamcryptoki
iamcryptoki / curl_github_actions_workflow.txt
Created March 1, 2021 15:42
Run GitHub Actions Workflow using Curl (workflow_dispatch).
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <ACCESS_TOKEN_HERE>" \
https://api.github.com/repos/<ORG_OR_USERNAME>/<REPO>/actions/workflows/<FILENAME_OR_WORKFLOW_ID>/dispatches \
-d '{"ref":"refs/heads/master"}'
@sindresorhus
sindresorhus / esm-package.md
Last active November 15, 2024 15:20
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@startuml OAuth basic flow with auth code and access token
skinparam monochrome true
skinparam defaultFontSize 14
' plantuml: https://plantuml.com/sequence-diagram
' source: https://gist.github.com/hrchu/d88efb56e72534a1233d16f36eb3e3e9
title OAuth basic flow with auth code and access token
actor "You/Browser" as b
participant "slack.com" as s