Skip to content

Instantly share code, notes, and snippets.

View leohxj's full-sized avatar
💯
Focusing

Leo Hui leohxj

💯
Focusing
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active May 7, 2024 08:55
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@zzjtnb
zzjtnb / Telegram解决+86不能私聊其他用户的方案:
Created November 18, 2018 08:09
@SpamBot 提出申请半小时内即可解开
Telegram 给某人发送私聊消息时遇到如下提示:
Sorry,you can only send messages to mutual contacts at the momet.
中文:抱歉,您现在只能给双向联系人发送消息。
原因:
前段时间币圈利用Telegram 的便利,大量发广告和拉人进群。Telegram 限制了+86 大陆手机号绑定的账号的私聊。
+86 的账号不能给非+86 的账号主动发起私聊,+86 的账号能给+86 主动发起私聊的;刚刚注册的+86 账号也不能发起私聊的,过段时间就OK了。
解决办法:
1. 两个人建立一个群来作为私聊交流
@lierdakil
lierdakil / example.ts
Last active September 19, 2022 13:28
An example of Functor in TypeScript. You can run this on https://www.typescriptlang.org/play/
interface Functor<T> {
map<U>(f: (x: T) => U): Functor<U>
}
class Box<T> implements Functor<T> {
value: T
constructor(x: T) {
this.value = x
}
map<U>(f: (x: T) => U): Box<U> {
@styblope
styblope / docker-api-port.md
Last active May 7, 2024 09:52
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@IanCarrasco
IanCarrasco / hyperguide.md
Last active February 22, 2023 10:15
How to Create a Hyper Terminal at a Folder

How to open hyper at current directory.

1.Go to the forked cd_to github repository and download the latest release.(zipped) Download From Github.

2.Within cd_to, open the Hyper folder and drag the cd_to.app file into your Applications folder MacDown Screenshot.

3.Now open up Automator and create a new service. File>New>Service(gear icon).Be sure to save the service with an effective name like "Hyper Terminal at Folder" MacDown Screenshot

@iffy
iffy / .gitignore
Last active April 17, 2024 07:19
Example using electron-updater with `generic` provider.
node_modules
dist/
yarn.lock
wwwroot
@paultibbetts
paultibbetts / -comparing-breakpoints-in-frameworks-toolkits.md
Last active April 16, 2024 13:07
Comparing Breakpoints in CSS Toolkits and Frameworks