This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I'm investingating impact of a recent supply chain attack. I need you to tell me exactly what version of these packages are we using. | |
| - ansi-styles@6.2.2 | |
| - debug@4.4.2 (appears to have been yanked as of 8 Sep 18:09 CEST) | |
| - chalk@5.6.1 | |
| - supports-color@10.2.1 | |
| - strip-ansi@7.1.1 | |
| - ansi-regex@6.2.1 | |
| - wrap-ansi@9.0.1 | |
| - color-convert@3.1.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Modifiers = { | |
| ctrl?: boolean; | |
| shift?: boolean; | |
| }; | |
| type HotkeyDetails = { key: string } & Modifiers; | |
| const hotkeyName = ({ key, ctrl, shift }: HotkeyDetails) => | |
| `hotkey:${ctrl || ""}+${shift || ""}+${key}`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { truncateMiddle } from '.'; | |
| describe('utils', () => { | |
| // ...pretty exaustive for a string utility, I know... | |
| describe('truncateMiddle', () => { | |
| const testStrings = [ | |
| '0x3172635bc846d0c68afce1738d048520dcfafed2d55d1866a5ed5a40d5ea66c7', // 66 chars | |
| '0000000000000000000000000000000000000000000000', // 46 chars | |
| '00000000000000000000000000000000000000000000000', // 47 chars | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const $ = document.querySelector.bind(document), | |
| $$ = document.querySelectorAll.bind(document), | |
| h = (name, props) => Object.assign(document.createElement(name), props); | |
| const context = [] | |
| const getCurrentObserver = () => context[context.length - 1] | |
| function createEffect(fn, name) { | |
| const execute = () => { | |
| context.push(execute) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const context: Function[] = [] | |
| function getCurrentObserver() { | |
| return context[context.length - 1] | |
| } | |
| function createEffect(fn: Function, name: string) { | |
| const execute = () => { | |
| context.push(execute) | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Inspired by https://github.com/codediodeio/sveltefire & previous stuff I did here https://gist.github.com/metruzanca/e516aac42c79d16c894883e88d8af5f8 | |
| import { CollectionReference, DocumentData, Firestore, Query, QueryDocumentSnapshot, QuerySnapshot, collection, onSnapshot } from "firebase/firestore"; | |
| import { Accessor, from } from "solid-js"; | |
| type CollectionSignal<T> = { | |
| signal: Accessor<T[]> | |
| ref: CollectionReference<T> | Query<T> | null | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Jira Column Points | |
| // @namespace metruzanca | |
| // @version 0.1.0 | |
| // @description Adds utilities to jira boards | |
| // @author metruzanca | |
| // @match https://*.atlassian.net/jira/software/c/projects/*/boards/* | |
| // ==/UserScript== | |
| function addStyle(cssString, container = document.head) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export type Success<Data> = readonly [Data, undefined]; | |
| export type Failure<Err = Error> = readonly [undefined, Err]; | |
| /** A cross between Rust and Golang exception handling. I greatly dislike exceptions */ | |
| export type Result<Data, Err = Error> = Promise<(Success<Data> | Failure<Err>)> | |
| export const Ok = <T>(data: T): Success<T> => [data, undefined] | |
| export const Err = <E = Error>(error: E): Failure<E> => [undefined, error] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "env": { | |
| "browser": true, | |
| "es2021": true | |
| }, | |
| "extends": [ | |
| "eslint:recommended", | |
| "plugin:@typescript-eslint/recommended" | |
| ], | |
| "ignorePatterns": ["**/*.js"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Internal type correctness is not the goal. The goal is good DX building out queriesx | |
| export class QueryBuilder { | |
| private collection: CollectionReference<DocumentData, DocumentData> | |
| constructor(path: string) { | |
| this.collection = collection(firestore, path) | |
| } | |
| private where: QueryFieldFilterConstraint[] = [] | |
| filter(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown) { | |
| this.where.push(where(fieldPath, opStr, value)) |
NewerOlder