Skip to content

Instantly share code, notes, and snippets.

View keidarcy's full-sized avatar
🧙‍♂️
making something

Xing Yahao keidarcy

🧙‍♂️
making something
View GitHub Profile
@keidarcy
keidarcy / alacritty.sytax.yml
Last active February 7, 2022 13:16
Alacritty default config file
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Import additional configuration files
#
# Imports are loaded in order, skipping all missing files, with the importing
# file being loaded last. If a field is already present in a previous import, it
# will be replaced.
#
# All imports must either be absolute paths starting with `/`, or paths relative
# to the user's home directory starting with `~/`.
@keidarcy
keidarcy / Gruvbox.md
Created January 24, 2022 02:22
gruvbox slack
  • dark
#282828,#3c3836,#98971a,#fbf1c7,#3E313C,#EBDBB2,#b8bb26,#fb4934,#3c3836,#EBDBB2
  • light
#282828,#3c3836,#98971a,#fbf1c7,#3E313C,#EBDBB2,#b8bb26,#fb4934,#3c3836,#EBDBB2
@keidarcy
keidarcy / jq-examples.md
Last active January 16, 2022 08:11
jq examples

Simple jq command

select, -r, length, reverse

curl -s "https://jsonplaceholder.typicode.com/todos" | jq '.[].completed'
curl -s "https://jsonplaceholder.typicode.com/todos" | jq '.[] | select(.completed==true)'
@keidarcy
keidarcy / .omt.sh
Last active November 23, 2021 06:14
oh my tmux sh
# oh my tmux https://github.com/gpakosz/.tmux
# require (perl, curl, tmux, git)
tmux_config_local='.tmux.conf.local'
cd ~
git clone https://github.com/gpakosz/.tmux.git
[ -f ~/dotfiles/tmux/$tmux_config_local ] && ln -sf ~/dotfiles/tmux/$tmux_config_local ~/.tmux/$tmux_config_local
ln -sf ~/.tmux/$tmux_config_local ~/$tmux_config_local
ln -sf ~/.tmux/.tmux.conf ~/.tmux.conf
# tmux source-file ~/.tmux.conf # reload tmux config
@keidarcy
keidarcy / emoji.txt
Last active May 5, 2023 21:56
Plain Github emoji list
:bowtie:
😄 :smile:
😆 :laughing:
😊 :blush:
😃 :smiley:
☺️ :relaxed:
😏 :smirk:
😍 :heart_eyes:
😘 :kissing_heart:
😚 :kissing_closed_eyes:
@keidarcy
keidarcy / helper.d.ts
Created September 26, 2021 08:43
type helpers
export type Expect<T extends true> = T
export type ExpectTrue<T extends true> = T
export type ExpectFalse<T extends false> = T
export type IsTrue<T extends true> = T
export type IsFalse<T extends false> = T
export type NotEqual<X, Y> = true extends Equal<X, Y> ? false : true
export type Equal<X, Y> =
(<T>() => T extends X ? 1 : 2) extends
(<T>() => T extends Y ? 1 : 2) ? true : false
@keidarcy
keidarcy / key.json
Created August 16, 2021 12:14
vscode keybind
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "cmd+n", // "cmd+n" on mac
"command": "extension.advancedNewFile",
},
{
"key": "escape", // cancel for vim multi-cursor mode
"command": "removeSecondaryCursors",
"when": "editorHasMultipleSelections && textInputFocus"
@keidarcy
keidarcy / webpack.config.ts
Created May 23, 2021 13:47
react-ts-webpack5
import path from 'path';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
import webpack from 'webpack';
// import HtmlWebpackPlugin from 'html-webpack-plugin';
const currentScript = process.env.npm_lifecycle_event;
console.log({ currentScript });
@keidarcy
keidarcy / .zshrc
Created February 13, 2021 05:35
default ohmyzsh config
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/dst/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="robbyrussell"
@keidarcy
keidarcy / fibonacci.js
Last active January 24, 2021 06:48
Find out the Sequencing of Fibonacci numbers
const fibonacci = (num) => {
if (Number.isNaN(+num)) {
return 'not a number';
}
let result = 0;
let tmp = 0;
let fiArr = [1, 1];
for (let i = 1; i < num; i++) {