Skip to content

Instantly share code, notes, and snippets.

View wai-lin's full-sized avatar
🐢
Slow code

Wai Lin wai-lin

🐢
Slow code
View GitHub Profile
@wai-lin
wai-lin / aes-everywhere.d.ts
Created June 1, 2022 08:13
aes-everywhere Type definitions
declare module 'aes-everywhere' {
export function encrypt(input: string, passphrase: string): string
export function decrypt(crypted: string, passphrase: string): string
}
@wai-lin
wai-lin / android_instructions.md
Created March 26, 2021 04:18 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@wai-lin
wai-lin / generate-ssh-key.sh
Last active June 2, 2021 15:28 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@wai-lin
wai-lin / Dockerfile
Last active August 15, 2020 17:08
MariaDB with Docker
FROM mariadb:10
ENV MYSQL_ROOT_PASSWORD=secret
ENV MYSQL_USER=local
ENV MYSQL_PASSWORD=local
EXPOSE 3306

How to create HTTPS dev envronment in Linux

Update

If you want to generate certificates manually follow up to the Create Certificate with OpenSSL in the next section. This is more recommended way of doing since you don't have to do the manual labour and free from the risk of human error.

The solution is using auto-generate tool called mkcert. It is written in go and work perfectly fine on almost every OS with super easy commands.

Theming Ant Design with Sass and Webpack

This is a solution on how to theme/customize Ant Design (which is written in Less) with Sass and webpack. Ant itself offers two solutions and a related article on theming, but these are only applicable if you use Less, the antd-init boilerplate or dva-cli.

What this solution offers:

  • use a single sass-file to customize (no duplicate variables for your project and Ant)
  • hot reload compatibility
  • no dependencies on outdated npm modules
  • easy integration with your existing webpack setup (webpack 3+ tested)