Skip to content

Instantly share code, notes, and snippets.

View crossjs's full-sized avatar
🎯
Focusing

李文富 crossjs

🎯
Focusing
View GitHub Profile
export type DeepPartial<T> = T extends Object
? {
[P in keyof T]?: DeepPartial<T[P]>;
}
: T;
- DOMAIN-SUFFIX,atlasauthority.com,🚀 节点选择
- DOMAIN-SUFFIX,beyond-six.biz,🚀 节点选择
- DOMAIN-SUFFIX,boutirapp.com,🚀 节点选择
- DOMAIN-SUFFIX,boutirstage.com,🚀 节点选择
- DOMAIN-SUFFIX,boutirror.com,🚀 节点选择
- DOMAIN-SUFFIX,crossjs.com,🚀 节点选择
- DOMAIN-SUFFIX,csvjson.com,🚀 节点选择
- DOMAIN-SUFFIX,fireworkanalytics.com,🚀 节点选择
- DOMAIN-SUFFIX,fireworktv.com,🚀 节点选择
- DOMAIN-SUFFIX,funteachingaids.com,🚀 节点选择
@crossjs
crossjs / bunny.js
Created December 5, 2021 16:17
Solution for Bunny Question in "Coding Interview with Dan Abramov"
// https://www.youtube.com/watch?v=XEt09iK8IXs
let pos = 2;
let len = 4;
function jump() {
if (pos === 0) {
pos += 1
} else if (pos === len - 1) {
pos -= 1
@crossjs
crossjs / example.tsx
Last active September 22, 2021 08:19
useSplitPane.ts
const { paneRef, handleProps } = useSplitPane({
onInit: (size, pane) => {
pane.style.width = `${size}px`;
pane.style.display = size ? 'block' : 'none';
},
onResize: (size, pane) => {
pane.style.width = `${size}px`;
pane.style.display = size ? 'block' : 'none';
},
});
@crossjs
crossjs / rollup.config.js
Created July 29, 2021 03:31
rollup.config.js
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import typescript from 'rollup-plugin-typescript2';
import commonjs from 'rollup-plugin-commonjs';
import copy from 'rollup-plugin-cpy';
import external from 'rollup-plugin-peer-deps-external';
import resolve from 'rollup-plugin-node-resolve';
import url from 'rollup-plugin-url';
import pkg from './package.json';
@crossjs
crossjs / Encrypt.js
Last active December 19, 2019 01:05
Encrypt number to string with provided radix chars
class Encrypt {
static create(chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') {
const radix = chars.length;
function encode(num) {
if (num < radix) {
return chars.charAt(num);
}
return `${encode(Math.floor(num / radix))}${chars.charAt(num % radix)}`;
}
function decode(str) {
@crossjs
crossjs / Balsamiq Mockups keys.txt
Created October 10, 2019 03:22 — forked from WahidurRahman7/Balsamiq Mockups keys.txt
Balsamiq Mockups keys for Windows and Mac
Name: Joseph
eJzzzU/OLi0odstPdypNr6rxyi9OLcioMTIysDQwNjIwMKhxNgSSABE9DGo=
Name: fb.com/josephgahm
eJzzzU/OLi0odstPdypNr6pJS9JLzs/Vz8ovTi3ISE/MyK0xMjKwNDA2MjAwqHE2BJIAyuUQiw==
Name: joseph graham
eJzzzU/OLi0odstPdypNr6rJyi9OLchQSC9KzEjMrTEyMrA0MDYyMDCocTYEkgCFYA8a
@crossjs
crossjs / Mac OS X: Open in Visual Studio Code
Created October 23, 2018 15:21 — forked from tonysneed/Mac OS X: Open in Visual Studio Code
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"
@crossjs
crossjs / taskkill.txt
Last active January 4, 2022 01:35
Kill a Process by Looking up the Port being used by it from a .BAT
C:\Users\username>netstat -o -n -a | findstr 0.0:3000
TCP 0.0.0.0:3000 0.0.0.0:0 LISTENING 3116
C:\Users\username>taskkill /F /PID 3116
@crossjs
crossjs / git-sync-fork-from-source.sh
Created June 27, 2017 07:35
git sync fork from source
git remote add upstream <url>
git fetch upstream
git merge upstream/master
git push