Skip to content

Instantly share code, notes, and snippets.

View maou-shonen's full-sized avatar

魔王少年(maou shonen) maou-shonen

View GitHub Profile
@maou-shonen
maou-shonen / gist:f5edfa6dadd798d0b002c4c006318c96
Last active February 24, 2025 07:19
monorepo typescript performance 2025
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.
export default App() {
useGoogleTranslate()
return (
<>
<div key="GoogleTranslate" id="google_translate_element" />
</>
)
}
@maou-shonen
maou-shonen / Suspense.ts
Last active September 17, 2021 07:11 — forked from ffxsam/Suspense.ts
Vue 3's Suspense component, ready for use in Nuxtjs 2.x (TypeScript)
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 ||
#!/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(':')
@maou-shonen
maou-shonen / BinaryUUID.py
Last active May 9, 2020 06:20
sqlalchemy BinaryUUID (mysql/mariadb)
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