Skip to content

Instantly share code, notes, and snippets.

View boydaihungst's full-sized avatar
💻

boydaihungst boydaihungst

💻
View GitHub Profile
@boydaihungst
boydaihungst / github_to_gitea_batch
Created March 17, 2024 13:01
github_to_gitea_batch
#!/bin/bash
GITHUB_USERNAME=
GITHUB_TOKEN=
GITHUB_ORGANISATION=
GITHUB_API_CALL=
GITHUB_MAX_PER_PAGE=100
GITHUB_CURRENT_PAGE=1
GITEA_TOKEN=
@boydaihungst
boydaihungst / rainbow-parens.scm
Last active March 3, 2023 07:33
nvim-rainbow-error
; interface a {}
(object_type
(("{" @opening)
("}" @closing))) @container
; not work
; const obj = { ...(true ? {} : {}) };
(parenthesized_expression
(("(" @opening)
(")" @closing))) @container
@boydaihungst
boydaihungst / what-forces-layout.md
Created February 20, 2023 18:43 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@boydaihungst
boydaihungst / proxy.pac
Created November 28, 2022 01:12
PAC green-tunnel
function FindProxyForURL(url, host) {
return "PROXY 127.0.0.1:8000";
}
@boydaihungst
boydaihungst / config.lua
Last active July 28, 2022 16:41
volar multiple lsp server - lunarvim
-- put file in here ~/.config/lvim/config.lua
vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, {
"vuels",
"volar",
})
-- Install treesitter vue
--lvim.builtin.treesitter.ensure_installed = {
-- "vue",
public async foldersFilter(
userId: string,
payload: FileFolderInput,
nextCursor?: {
id: string;
sortedValue: any;
},
nextOptions: any = {},
) {
@boydaihungst
boydaihungst / aliases.config.js
Last active May 2, 2021 02:17
Use this file to generate alias.
const path = require('path');
const aliases = {
'@': '.',
'@src': './src',
'@router': './src/router',
'@views': './src/router/views',
'@layouts': './src/router/layouts',
'@components': './src/components',
'@assets': './src/assets',
router.beforeEach(async (to, from, next) => {
const localeInParams = getLocaleFromParams(to.params); //DIY
const isNewLocale =
localeInParams !== undefined && localeInParams !== currentLocale;
if (isNewLocale) {
const isNewLocaleSupported = SUPPORT_LOCALES.includes(localeInParams);
if (!isNewLocaleSupported) {
return next(redirectToFallbackLocale(currentLocale, to.fullPath));
}
await localeMessageChange(i18n, localeInParams);
export abstract class RepoBase<T> extends Repository<T> {
async customFind(optionsOrConditions?: FindManyOptions<T> | Partial<T>) {
const connection = this.manager.connection;
const metadata = this.metadata;
if (
metadata.deleteDateColumn &&
optionsOrConditions &&
'withDeleted' in optionsOrConditions &&
!optionsOrConditions.withDeleted
) {
{
"compilerOptions": {
"experimentalDecorators": true,
"target": "ES2018",
"module": "CommonJS",
"moduleResolution": "node",
"esModuleInterop": true,
"emitDecoratorMetadata": true,
"resolveJsonModule": true,
"strictNullChecks": false,