Skip to content

Instantly share code, notes, and snippets.

View uxiew's full-sized avatar
🏠
SEEKING WORK

抬头看乌鸦啊 uxiew

🏠
SEEKING WORK
View GitHub Profile
@uxiew
uxiew / clean_node_modules.sh
Created August 21, 2024 10:16 — forked from zephraph/clean_node_modules.sh
A shell script to clean up all node_modules in projects that haven't been touched in a couple weeks.
#!/bin/bash
DAYS_SINCE_LAST_CHANGE=14 # If a project hasn't been touched in this long its node_modules will be deleted
SEARCH_PATH="./Git" # Update this to the path where your code is stored
TOTAL_BYTES_REMOVED=0
Mb=1000000
Kb=1000
node_modules=$(find $SEARCH_PATH -name "node_modules" -type d -prune)
@uxiew
uxiew / usePoller.ts
Created August 21, 2024 10:15 — forked from ds300/usePoller.ts
usePoller.ts
import { useCallback, useEffect, useMemo } from 'react'
export class Poller<T> {
private interval: ReturnType<typeof setInterval> | null = null
constructor(
private readonly callback: (arg: { didCancelRef: { current: boolean } }) => T,
private readonly intervalMs: number
) {}
readonly didCancelRef = { current: false }
start() {
@uxiew
uxiew / Material Theme.itermcolors
Created August 12, 2024 10:35 — forked from Revod/Material Theme.itermcolors
Material Theme For iTerm2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Color Space</key>
<string>sRGB</string>
<key>Blue Component</key>
<real>0.25882352941176473</real>
@uxiew
uxiew / esm-package.md
Created February 3, 2024 13:24 — forked from sindresorhus/esm-package.md
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.
@uxiew
uxiew / README.md
Last active January 30, 2024 06:32 — forked from axetroy/README.md
nginx接口转发/代理/单页面应用配置

关于nginx的小小笔记

不常用,没过一段时间都要去搜一下,干脆自己记下来

重启nginx服务器

/etc/init.d/nginx restart
# or
service nginx restart
@uxiew
uxiew / cheerioReq.ts
Created February 26, 2023 10:58
some code files
// Copyright (c) 2022 ChandlerVer5
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
import Cheerio, { CheerioAPI } from 'cheerio';
import tinyreq from 'tinyreq';
type Result = {
$: CheerioAPI;
@uxiew
uxiew / git.sh
Last active August 10, 2021 15:20 — forked from taoyuan/npm-using-https-for-git.sh
git command help
# npm using https for git
git config --global url."https://github.com/".insteadOf [email protected]:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."[email protected]:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@uxiew
uxiew / it-ebooks.md
Created November 17, 2018 15:50 — forked from baiwfg2/it-ebooks.md
Download ebooks as you want
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">