Skip to content

Instantly share code, notes, and snippets.

View ethan605's full-sized avatar

Thanh Nguyen ethan605

View GitHub Profile
const fs = require('fs');
const path = require('path');
const _ = require('lodash');
const fp = require('lodash/fp');
const anyAscii = require('any-ascii');
const BASE_PATH = '~/Downloads/';
function normalizeTitle(title) {
@ethan605
ethan605 / qrgpg.sh
Last active April 5, 2024 15:13
qrgpg - encode/decode ASCII armoured file to/from QRCode images
#!/usr/bin/env bash
set -Eeuo pipefail
readonly RED=$(tput setaf 1)
readonly GREEN=$(tput setaf 2)
readonly YELLOW=$(tput setaf 3)
readonly NORMAL=$(tput sgr0)
readonly COMMAND="qrgpg"
SUB_COMMAND=""
@ethan605
ethan605 / !nerdfont-icons
Last active March 30, 2023 12:33
List all icons supported by a nerd font
We couldn’t find that file to show.
@ethan605
ethan605 / .eslintrc.js
Last active September 5, 2019 07:46
A simple method to flatten an array of arbitrarily nested arrays of integers into a flat array of integers
module.exports = {
env: {
es6: true,
node: true,
jest: true,
},
extends: [
'eslint:recommended',
'plugin:prettier/recommended',
'prettier/standard'

Keybase proof

I hereby claim:

  • I am ethan605 on github.
  • I am ethan605 (https://keybase.io/ethan605) on keybase.
  • I have a public key whose fingerprint is 4B32 8F02 F02A 0D5C 2312 7E7E C086 CD9B 4DBC BBC0

To claim this, I am signing this object:

@ethan605
ethan605 / gulp.babel.js
Last active December 5, 2018 07:45
Gulp task to convert locale json file <=> csv
/**
* I18n translations helpers
*/
// Built-in modules
import fs from 'fs';
// Gulp modules
import gulp from 'gulp';
import clean from 'gulp-clean';
@ethan605
ethan605 / KBD75.md
Last active April 18, 2020 04:43
Mechanical keyboards

1. Flash instructions

  1. Install Homebrew.
  2. Download and install QMK Toolbox. NOTE: If the application can't be opened normally, may be it's lacking libusb library:
  $ brew install libusb
  1. Run commands:

Architectures & Patterns

  • MVVM (Model - View - View Model): to avoid Massive View Controllers, but simpler than VIPER
  • ReactiveCocoa: functional reactive programming in Swift, supports hot/cold signals, active community
  • RxSwift: functional reactive programming in Swift, backed by ReactiveX, syntax-friendly & compatible with other ReactiveX extensions (RxJS etc...)  

Layouts

  • Storyboard: for specific UI customizations (colors, images,...)
  • SnapKit: for flexible layout rendering without touching complicated AutoLayout setups
/**
* @providesModule WeFit.Redux.Store.createStorePersistor
*/
import { AsyncStorage, Platform } from 'react-native';
import { Logger } from '@onaclover/react-native-utils';
import { createPersistor, createTransform, getStoredState } from 'redux-persist';
import FilesystemStorage from 'redux-persist-filesystem-storage';
import _ from 'lodash';
import React from 'react';
import { StyleSheet, View } from 'react-native';
import Button from 'react-native-button';
import _ from 'lodash';
export default class ZIndexExp extends React.PureComponent {
state = { topBoxIndex: 2 };
changeTopBox = () => {
const { topBoxIndex } = this.state;