Skip to content

Instantly share code, notes, and snippets.

View spion's full-sized avatar
:shipit:

Gorgi Kosev spion

:shipit:
View GitHub Profile
View chatgpt-export-markdown.user.js
// ==UserScript==
// @name ChatGPT save to Markdown button
// @author spion, avosirenfal
// @description Adds an export button for exporting the doc to markdown
// @namespace chatgpt
// @version 1.0.0
// @match https://chat.openai.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
@spion
spion / docker-compose.yaml
Created November 3, 2022 17:24
two keycloaks
View docker-compose.yaml
version: '3.6'
services:
keycloak_one:
image: quay.io/keycloak/keycloak:16.1
volumes:
- keycloak_one_data:/opt/keycloak/data
command: start-dev
ports:
- 8081:8080
environment:
View 01-include-dir-and-apply-transforms.ts
import { ApiObject, GroupVersionKind, Include } from "cdk8s";
import { Construct } from "constructs";
import * as immer from "immer";
import * as fs from "fs";
type UnReadonly<T> = T extends string | number | boolean | null
? T
: T extends ReadonlyArray<infer U>
? Array<UnReadonly<U>>
: { -readonly [K in keyof T]: UnReadonly<T[K]> };
View example-filesize.ts
import * as L from "lodash";
const files = `
109 CLI/CLIClass.ts
67 CLI/index.ts
3 index.ts
45 Models/DisplayMap.ts
1 Models/Environment.ts
6 Models/index.ts
5 Models/Options.ts
View estimate.md

Software estimation Q&A

Q: What do the points mean?

A: Lets say we have two engineers, E1 and E2, estimating a story S. E1 believes the story can be done in time T1. E2 believes it can be done in time T2.

We assign the velocity numbers V1 and V2 to these two engineers, such that

View sync-async-adapter.js
let Read = {};
let End = {};
function* lexer() {
let accumulatedChars = [];
while (true) {
let inp = yield Read;
if (inp === End) {
if (accumulatedChars.length > 0) yield accumulatedChars.join('');
return;
View simplified.ts
function inRange(a: number, min: number, max: number) {
return min <= a && a <= max;
}
class UTF8Encoder {
bytes = new Uint8Array(4).fill(0)
len = 0;
toBytes(codePoint: number):void {
View techempower.diff
diff --git a/frameworks/JavaScript/express/express-postgres.dockerfile b/frameworks/JavaScript/express/express-postgres.dockerfile
index f2907bd02..9b2196082 100644
--- a/frameworks/JavaScript/express/express-postgres.dockerfile
+++ b/frameworks/JavaScript/express/express-postgres.dockerfile
@@ -1,9 +1,9 @@
FROM node:12.3.1-slim
-COPY ./ ./
-
+COPY package.json ./
View mobx.js
@observer class Chart(props) {
@computed get data() { return getDataWithinRange(this.props.dateRange) }
@computed get dimensions() { return getDimensions() }
@computed get xScale() { return getXScale() }
@computed get yScale() { return getYScale() }
render() {
// use this.xScale, this.yScale etc. component will re-render automatically if any of those update.
return <svg className="Chart" />
}