Skip to content

Instantly share code, notes, and snippets.

@Yelmor
Yelmor / linux_signing_key.pub
Last active September 20, 2023 03:14
google chrom linux
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
mQGiBEXwb0YRBADQva2NLpYXxgjNkbuP0LnPoEXruGmvi3XMIxjEUFuGNCP4Rj/a
kv2E5VixBP1vcQFDRJ+p1puh8NU0XERlhpyZrVMzzS/RdWdyXf7E5S8oqNXsoD1z
fvmI+i9b2EhHAA19Kgw7ifV8vMa4tkwslEmcTiwiw8lyUl28Wh4Et8SxzwCggDcA
feGqtn3PP5YAdD0km4S4XeMEAJjlrqPoPv2Gf//tfznY2UyS9PUqFCPLHgFLe80u
QhI2U5jt6jUKN4fHauvR6z3seSAsh1YyzyZCKxJFEKXCCqnrFSoh4WSJsbFNc4PN
b0V0SqiTCkWADZyLT5wll8sWuQ5ylTf3z1ENoHf+G3um3/wk/+xmEHvj9HCTBEXP
78X0A/0Tqlhc2RBnEf+AqxWvM8sk8LzJI/XGjwBvKfXe+l3rnSR2kEAvGzj5Sg0X
@Yelmor
Yelmor / defineConstants.ts
Created December 22, 2022 09:00
defineConstants.ts
interface IBaseDef {
key: PropertyKey;
value: string | number;
}
type ToPropertyPrefix<N extends string = ''> = N extends '' ? '' : `${N}_`;
type ToProperty<
Property extends string,
N extends string = '',
@Yelmor
Yelmor / leanote_export.ts
Created July 4, 2021 11:08
export data from leanote
/**
* leanote 接口参考:https://github.com/leanote/desktop-app/blob/c34c847586fbb566eb8ea4e87f2e7acd5c088221/src/api.js
*/
import Axios from 'axios';
import * as fs from 'fs/promises';
import * as path from 'path';
import * as Debug from 'debug';
const log = Debug('leanote_export');
// Through the options literal, the behaviour of the editor can be easily customized.
// Here are a few examples of config options that can be passed to the editor.
// You can also call editor.updateOptions at any time to change the options.
const source = `
package examples
/** This examples illustrates the use of Guarded
* Algebraic Data Types in Scala. For more information
* please refer to the Scala specification available
@Yelmor
Yelmor / delete_node_modules
Created January 1, 2021 12:42
delete all node_modules
const fs = require('fs');
const path = require('path');
const fsPromises = fs.promises;
async function rm(startPath, depth) {
const rmPromises = [];
const files = await fsPromises.readdir(startPath);
if (depth === 0) {
return;
}
@Yelmor
Yelmor / decorator_run_order.ts
Last active August 27, 2019 07:59
typescript decorator run order
function Mark(message: string) {
console.log('create', message);
return function (target: any, propertyKey?: string | symbol, propertyDescriptionOrIndex?: PropertyDescriptor | number) {
console.log('run', message);
}
}
@Mark('A')
class A {
@Mark('A.m0')