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
@Component({ | |
selector: "window-size", | |
changeDetection: ChangeDetectionStrategy.OnPush, | |
template: ` | |
<div> | |
<p>Height: {{ height }}</p> | |
<p>Width: {{ width }}</p> | |
</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
<html lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<meta name="viewport" content="width=device-width"/> | |
</head> | |
<body style="height: 300vh"> | |
<svg style="position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);" | |
width="655" height="209" viewBox="0 0 655 209" fill="none" xmlns="http://www.w3.org/2000/svg"> | |
<path d="M653 207V62C653 28.8629 626.228 2 593.091 2C519.318 2 391.639 2 292.675 2C270.583 2 252.717 19.9124 252.717 42.0038C252.717 63.5378 252.717 81.7221 252.717 81.7221C252.717 81.7221 252.717 81.7221 252.717 81.7221V167C252.717 189.091 234.808 207 212.717 207H2" | |
stroke="#EAECF0" stroke-width="4" stroke-linecap="round"/> |
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
function signal<T>(initialValue: T) { | |
let value: T = initialValue; | |
function getValue() { | |
return value; | |
} | |
getValue.set = (newValue: T) => { | |
value = newValue; | |
} |
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
function generateState() { | |
if (!window.executeCount) { | |
window.executeCount = 0 | |
} | |
window.executeCount++ | |
return { | |
count: window.executeCount, | |
} | |
} |
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
Polypane 15.0.1 Firstversionist.Polypane 15.0.1 winget | |
Open Video Downloader 2.5.4 jely2002.youtube-dl-gui 2.5.4 winget | |
Mullvad VPN 2023.6.0 MullvadVPN.MullvadVPN 2023.6.0 winget | |
ModernFlyouts (Preview) ModernFlyouts.ModernFlyouts 0.9.3.0 winget | |
NVM for Windows CoreyButler.NVMforWindows Unknown 1.1.11 winget | |
Plexamp 4.8.4 Plex.Plexamp 4.8.4 4.9.4 winget | |
SideQuest 0.10.38 SideQuestVR.SideQuest 0.10.38 0.10.39 winget | |
GDLauncher 1.1.30 GorillaDevs.GDLauncher 1.1.30 winget | |
Cisco Webex Meetings Cisco.CiscoWebexMeetings |
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
// Given an input | |
const input = "header 123 {#custom-id}" | |
// Provide a tranformation of said input that keeps the same length | |
// IE: "Capitalizing" a title in a markdown file | |
const transformedInput = input.toUpperCase(); | |
// However, we don't want to transform this regex | |
// IE: A custom ID | |
const ignored = ["{#custom-id}"] | |
// From this, our output should be: |
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
function identity<T>(arg: T): T { | |
return arg; | |
} | |
const val = identity(1 as const); | |
// ^ 1 | |
// ---------------------- Works with classes too --------------------------------------------- | |
class IdentityWithMeta<T> { |
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
/** | |
* ["a", "b", "c"] => ["a" | "b" | "c", "a" | "b" | "c", "a" | "b" | "c"] | |
* | |
* Assumes keys are unique | |
*/ | |
export type LoosenTuple< | |
Arr extends readonly any[], | |
OriginalArr extends readonly any[] = Arr, | |
> = Arr extends readonly [unknown, ...infer Tail] | |
? readonly [OriginalArr[number], ...LoosenTuple<Tail, OriginalArr>] |
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
{ | |
"name": "@mitosis.template/templating-base", | |
"version": "0.0.1", | |
"description": "", | |
"repository": { | |
"type": "git", | |
"url": "git+https://github.com/crutchcorn/mitosis-template.git" | |
}, | |
"bugs": { | |
"url": "https://github.com/crutchcorn/mitosis-template/issues" |
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
<button data-on-click="updateCount()">Count</button> | |
<p>Count: {{count.value}}</p> | |
<p>Double: {{double.value}}</p> | |
<p data-if="count.value % 2 === 0">{{count.value}} is even</p> | |
<p data-if="count.value % 2 !== 0">{{count.value}} is odd</p> | |
<Child/> |
NewerOlder