Skip to content

Instantly share code, notes, and snippets.

Avatar

Edward Chu chuyik

View GitHub Profile
@chuyik
chuyik / README.md
Created Dec 4, 2020
set up java_home
View README.md
# install java
brew install java

# link
sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

# check
java --version
/usr/libexec/java_home
@chuyik
chuyik / gist:e7dc74d6f1bf1725a01bf95e095067fd
Created May 26, 2020
macOS 出现「䀋」的解决方法
View gist:e7dc74d6f1bf1725a01bf95e095067fd

当浏览器显示「低」字的时候,有可能会显示错误,出现「䀋」字。

这种字符的错误映射目前只发现在「Hiragino Sans GB」字体上出现,解决方法是:

打开 FontBook,找到「Hiragino Sans GB」字体,Disable & Enable 即可。

View custom_type_guards.ts
interface LayerEffect {
opacity?: number
}
interface DropShadowEffect extends LayerEffect {
blur?: number
}
interface ColorEffect extends LayerEffect {
color?: string
@chuyik
chuyik / export_keynote.scpt
Created Mar 8, 2019
Keynote Presenter Notes Exporter 演讲者注释导出脚本
View export_keynote.scpt
--==============================
-- Send Keynote Text to Desktop Markdown File
-- Writted By: Richard Dooling https://github.com/RichardDooling/
-- Based on
-- Send Keynote Presenter Notes to Evernote
-- Version 1.0.1
-- Written By: Ben Waldie <ben@automatedworkflows.com>
-- http://www.automatedworkflows.com
-- Version 1.0.0 - Initial release
@chuyik
chuyik / install.sh
Last active Oct 12, 2018
rsync like git
View install.sh
rsync --info=progress2 \
-a -c --progress \
--delete \
--delete-excluded --exclude=".git/" \
/path/to/folder/. /newpath/to/folder/
@chuyik
chuyik / README.md
Last active Aug 2, 2018
Install and Config Rust
View README.md
@chuyik
chuyik / omit.js
Created Jul 25, 2018
Test _.omit performance
View omit.js
const speedy = require('speedy')
const _ = require('lodash')
/**
==================
Test Result
==================
Node v10.1.0
V8 v6.6.346.27-node.6
@chuyik
chuyik / index.bash
Last active Dec 17, 2019
Centos 6 curl SSL problem
View index.bash
# use this to debug git fetch
export GIT_CURL_VERBOSE=1
# use aliyun mirror to install new packages
wget -O /etc/yum.repos.d/Alibaba.repo http://mirrors.aliyun.com/repo/Centos-6.repo
yum update -y nss curl libcurl
@chuyik
chuyik / random-match.js
Created Mar 7, 2018
Randomly match elements between two arrays
View random-match.js
/* eslint-disable lodash/import-scope, no-console */
const _ = require('lodash')
const aArr = _.times(4, i => String.fromCharCode(97 + i))
const bArr = _.times(3, i => String.fromCharCode(65 + i))
/**
* 随机组合数组的元素
* 具体逻辑:
* 先随机索引,两两配对。
@chuyik
chuyik / centos_6_repo_setup.sh
Last active Dec 17, 2019
各种 centos 6 依赖库
View centos_6_repo_setup.sh
# backup
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
# aliyun
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
wget -O /etc/yum.repos.d/ius.repo http://mirrors.aliyun.com/ius/ius-6.repo
# epel
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm