Skip to content

Instantly share code, notes, and snippets.

View romoo's full-sized avatar
💡
Working

Romoo romoo

💡
Working
  • Beijing, China
  • 02:01 (UTC +08:00)
  • X @romoo
View GitHub Profile
@xqm32
xqm32 / clash-config.yaml
Last active May 21, 2024 12:17
clash config with proxy-providers and rule-providers
##### 使用说明 #####
# 1. 请填写 proxy-providers - subscribe - url 为订阅链接
# 2. 下载 https://github.com/Loyalsoldier/clash-rules/archive/refs/heads/release.zip 并解压至 ./profiles/ruleset 文件夹下
# 3. 若需要自动更新 ruleset, 请编辑 rule-providers-config - type 为 http
##### 参考链接 #####
# 1. clash 样例配置文件
# https://lancellc.gitbook.io/clash/clash-config-file/an-example-configuration-file
# 2. clash 规则集
# https://github.com/Loyalsoldier/clash-rules
#zero downtime deployment nextjs without vercel
echo "Deploy starting..."
git pull
npm install || exit
BUILD_DIR=temp npm run build || exit
@danielwetan
danielwetan / nodejs-cicd-github-actions.md
Last active May 23, 2024 15:32
Deploy Node.js to VPS using Github Actions

Deploy Node.js to VPS using Github Actions

Steps to deploy Node.js to VPS using PM2 and Github Actions

1. Clone repo to VPS folder

@sindresorhus
sindresorhus / esm-package.md
Last active May 25, 2024 20:03
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.
@sdhzdmzzl
sdhzdmzzl / bj-unicom-iptv.m3u
Last active May 8, 2024 10:36
北京联通iptv列表
#EXTM3U name="bj-unicom-iptv"
#EXTINF:-1,CCTV1
rtp://239.3.1.1:8000
#EXTINF:-1,CCTV2
rtp://239.3.1.2:8004
#EXTINF:-1,CCTV4
rtp://239.3.1.4:8216
#EXTINF:-1,CCTV7
rtp://239.3.1.7:8024
#EXTINF:-1,CCTV9
@matthewsuan
matthewsuan / axios.js
Last active March 28, 2024 12:36
Axios request queue-like that limits number of requests at any given time
import axios from 'axios'
const MAX_REQUESTS_COUNT = 5
const INTERVAL_MS = 10
let PENDING_REQUESTS = 0
// create new axios instance
const api = axios.create({})
/**
@joranquinten
joranquinten / generate-sitemap.js
Created January 22, 2019 14:03
Generate sitemap XML for NextJs static sites based on exportPathMap
/*
Generates a sitemap based on the entries in exportPathMap in next.config.js file
Author: Joran Quinten
Don't forget to add the domain name as process variable PUBLIC_DOMAIN!
Trigger the file with a separate script in your package.json and add it to your build command in Netlify
(for instance, set Build command to: "npm run production && npm run postexport")
@yufengwang
yufengwang / .npmrc
Created November 13, 2018 02:07 — forked from SimonTart/.npmrc
npmrc config for china
registry=https://registry.npm.taobao.org
disturl=https://npm.taobao.org/dist
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/
electron_mirror=https://npm.taobao.org/mirrors/electron/
chromedriver_cdnurl=https://npm.taobao.org/mirrors/chromedriver
operadriver_cdnurl=https://npm.taobao.org/mirrors/operadriver
selenium_cdnurl=https://npm.taobao.org/mirrors/selenium
node_inspector_cdnurl=https://npm.taobao.org/mirrors/node-inspector
fsevents_binary_host_mirror=http://npm.taobao.org/mirrors/fsevents/
@a-barbieri
a-barbieri / README.md
Last active June 6, 2021 21:48
NextJS sitemap generator with dynamic URL

NextJS sitemap generator

Install

The current setup has been tested on Next Js 7.0.0.

You need to install Axios.

$ npm install axios
@joeytwiddle
joeytwiddle / async-await-forEach-alternatives.md
Last active May 24, 2024 23:18
Do not use forEach with async-await

Do not use forEach with async-await

TLDR: Use for...of instead of forEach() in asynchronous code.

For legacy browsers, use for...i or [].reduce()

To execute the promises in parallel, use Promise.all([].map(...))

The problem