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
https://publish.reddit.com/embed?url=https://www.reddit.com/r/typescript/comments/1gfv564/comment/lun6u6i/ | |
1. Enable Incremental and Composite | |
2. Set module and moduleResolution both to NodeNext | |
3. With typescript@beta, rewriteRelativeImportExtensions, erasableSyntaxOnly and Node 23, you can drop tsx | |
4. Enable isolatedModules, verbatimModuleSyntax and isolatedDeclarations | |
5. Enable skipDefaultLibCheck and skipLibCheck | |
6. Drop npm/yarn and switch to pnpm (or deno or bun or berry) | |
7. Configure ESLint to use strict-type-checked and stylistic-type-checked. These two contains performance-enhancing rules. |
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 default App() { | |
useGoogleTranslate() | |
return ( | |
<> | |
<div key="GoogleTranslate" id="google_translate_element" /> | |
</> | |
) | |
} |
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 Vue from 'vue' | |
export default Vue.extend({ | |
name: 'Suspense', | |
render(createElement) { | |
const defaultVNode = this.$slots.default![0] | |
const isdefaultVNodeExist = | |
defaultVNode.elm !== undefined || | |
defaultVNode.componentOptions !== undefined || |
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
#!/usr/bin/python | |
# A Wake on LAN program that allows you to send magic packets over the Internet | |
# needs python >= 3.6 | |
import socket, struct, argparse | |
class WakeOnLan(): | |
def _makeMagicPacket(self, mac_address_str: str) -> bytes: | |
# Take the entered MAC address and format it to be sent via socket | |
mac_address = mac_address_str.split(':') |
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
from uuid import UUID | |
from sqlalchemy.types import TypeDecorator | |
from sqlalchemy.dialects.mysql import BINARY | |
class BinaryUUID(TypeDecorator): | |
impl = BINARY(16) | |
def process_bind_param(self, value, dialect=None): | |
if not value: | |
return None |