- npm init
- git ignore
- ni ts
- add tsconfig.json, tsconfig.1.json, tsconfig2.json (+ schema)
- add file.ts, file1.ts, file2.ts with params example
- run from terminal, show IDE
- add TS Config no property index
- run from terminal, show IDE
- Fix
- run from terminal, show IDE
This file contains 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
"use client"; | |
import { startTransition, type TransitionFunction } from "react"; | |
function useStartTransition<Args extends unknown[]>( | |
cb: (...args: Args) => ReturnType<TransitionFunction>, | |
) { | |
return (...args: Args) => startTransition(() => cb(...args)); | |
} |
This file contains 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
{ | |
"compilerOptions": { | |
"strict": true, | |
"noEmitOnError": false, | |
"useUnknownInCatchVariables": false, | |
"forceConsistentCasingInFileNames": true, | |
"noFallthroughCasesInSwitch": true, | |
"noImplicitOverride": true, | |
"noImplicitReturns": true, | |
"exactOptionalPropertyTypes": true, |
This file contains 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 { | |
inject, | |
provide, | |
type InjectionKey, | |
type SlotsType, | |
type ComputedRef, | |
computed, | |
toRef, | |
defineComponent, | |
} from 'vue'; |
This file contains 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
<script setup> | |
import LocalScope from './LocalScope.vue' | |
</script> | |
<template> | |
<LocalScope item-classes="rounded p-3 bg-blue-500" #default="{ itemClasses }"> | |
<div :class="itemClasses"> | |
No Data | |
</div> |
This file contains 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
let key = document.querySelector(`[data-testid="issue.views.issue-base.foundation.breadcrumbs.current-issue.item"]`).textContent; | |
let title = document.querySelector(`[data-testid="issue.views.issue-base.foundation.summary.heading"]`).textContent; | |
let link = document.querySelector(`[data-testid="issue.views.issue-base.foundation.breadcrumbs.current-issue.item"]`).href; | |
let date = new Date().toLocaleDateString('it-IT'); | |
let textMessage = `🔵 [${key}] - ${title} - ${date}`; | |
let htmlMessage = `🔵 [<a href="${link}">${key}</a>] - ${title} - ${date}`; | |
let textBlob = new Blob([textMessage], { type: 'text/plain' }); | |
let htmlBlob = new Blob([htmlMessage], { type: 'text/html' }); | |
let clipboardItem = new ClipboardItem({ [textBlob.type]: textBlob, [htmlBlob.type]: htmlBlob }); | |
globalThis.navigator.clipboard.write([clipboardItem]); |
This file contains 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 cacheControlDirective = new GraphQLDirective({ | |
name: 'cacheControl', | |
locations: [ | |
DirectiveLocation.FIELD_DEFINITION, | |
DirectiveLocation.OBJECT, | |
DirectiveLocation.INTERFACE, | |
DirectiveLocation.UNION, | |
], | |
args: { | |
maxAge: { |
This file contains 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
$$('ytd-playlist-video-renderer .style-scope ytd-thumbnail-overlay-time-status-renderer') | |
.map(e => e.textContent.trim().split(':').reverse()) | |
.map(([s = '0', m = '0', h = '0']) => ({ s: parseInt(s), m: parseInt(m), h: parseInt(h) })) | |
.map(({ s, m, h }) => s + m * 60 + h * 3600) | |
.reduce((a, b) => a + b) / 3600 |
This file contains 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
$$('.runtimeLabel') | |
.map(e => e.textContent.trim().replace('Length: ','')) | |
.map(text => { | |
const hasHours = text.includes('and') | |
const [hText, mText] = hasHours | |
? text.split(' and ') | |
: ['0 hrs', text] | |
const h = Number.parseInt(hText) | |
const m = Number.parseInt(mText) | |
return h * 60 + m |
NewerOlder