Skip to content

Instantly share code, notes, and snippets.

View kaczor6418's full-sized avatar
🕷️

Krzysztof Kaczyński kaczor6418

🕷️
View GitHub Profile
@kaczor6418
kaczor6418 / ManualClassMock.ts
Last active March 11, 2022 10:17
Tyoe for manual calss mocks
type FunctionReturnTypes<T> = {
[K in keyof T as T[K] extends Function ? K : never]:
T[K] extends (...args: any) => infer R ? R : never
};
type ClassFieldsTypes<T> = {
[K in keyof T]: T[K]
}
type ManualClassMock<T> = Partial<FunctionReturnTypes<T>> | Partial<ClassFieldsTypes<T>>;
@kaczor6418
kaczor6418 / instructions
Last active June 17, 2021 00:41
AMD + NVIDIA setup on linux manjaro / arch
#FOR ARCH LINUX#
sudo pacman -S nvidia #or nvidia-lts if linux-lts
sudo gedit /etc/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf
#text
Section "OutputClass"
Identifier "intel" # or amd
MatchDriver "i915" # can be removed if amd
Driver "modesetting"
EndSection
@kaczor6418
kaczor6418 / App.ts
Created January 16, 2021 22:17
How to connect WebAssembly-Rust with TypeScript (WebComponents)
import { KKMath } from 'kk-math';
const template: string = `
<h1>WebAssembly - Rust + TypeScript</h1>
<span></span>
<button>Calculate expression</button>
<p></p>
`;
export class App extends HTMLElement {