Current
html.div([], [
html.button([event.on_click(Increment)], [
element.text("+")
]),
element.text(count),
html.button([event.on_click(Decrement)], [
element.text("-")
]),| 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. | |
| - [email protected] | |
| - [email protected] (appears to have been yanked as of 8 Sep 18:09 CEST) | |
| - [email protected] | |
| - [email protected] | |
| - [email protected] | |
| - [email protected] | |
| - [email protected] | |
| - [email protected] |
| type Modifiers = { | |
| ctrl?: boolean; | |
| shift?: boolean; | |
| }; | |
| type HotkeyDetails = { key: string } & Modifiers; | |
| const hotkeyName = ({ key, ctrl, shift }: HotkeyDetails) => | |
| `hotkey:${ctrl || ""}+${shift || ""}+${key}`; |
Current
html.div([], [
html.button([event.on_click(Increment)], [
element.text("+")
]),
element.text(count),
html.button([event.on_click(Decrement)], [
element.text("-")
]),| 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 | |
| ]; |
| 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) |
| const context: Function[] = [] | |
| function getCurrentObserver() { | |
| return context[context.length - 1] | |
| } | |
| function createEffect(fn: Function, name: string) { | |
| const execute = () => { | |
| context.push(execute) | |
| try { |
| // 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 | |
| } |
| // ==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) { |
| 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] |
| { | |
| "env": { | |
| "browser": true, | |
| "es2021": true | |
| }, | |
| "extends": [ | |
| "eslint:recommended", | |
| "plugin:@typescript-eslint/recommended" | |
| ], | |
| "ignorePatterns": ["**/*.js"], |