Skip to content

Instantly share code, notes, and snippets.

View trylovetom's full-sized avatar
Falling in Love with JavaScript~

CHANG, TZU-YEN trylovetom

Falling in Love with JavaScript~
View GitHub Profile
taiansu /
Last active March 24, 2019 04:21
Install Elixir and phoenix

Elixir 安装導覧


  1. Elixir
  2. Node.js
  3. Postgresql 資料庫
  4. Phoenix

由於 macOS 及 linux 可以使用 asdf 這個語言版本管理器,所以我們將介紹用它來安裝 elixir 及 nodejs 的方式。而 Windows 則會使用 chocolatey 來安裝。

rswanderer / .eslintrc-parameter-instruction.js
Last active September 8, 2023 01:59
* ESLint的JSON文件是允许JavaScript注释的,但在gist里显示效果不好,所以我把.json文件后缀改为了.js
* ESLint 配置文件优先级:
* .eslintrc.js(输出一个配置对象)
* .eslintrc.yaml
* .eslintrc.yml
JamieMason /
Last active May 17, 2022 17:38
ES6 JavaScript compose function

ES6 JavaScript Compose Function


const compose = (...fns) =>
  fns.reduceRight((prevFn, nextFn) =>
    (...args) => nextFn(prevFn(...args)),
    value => value
msikma / rfc5646-language-tags.js
Created February 26, 2015 13:51
RFC 5646 Language Tags
// List of language tags according to RFC 5646.
// See <> for info on how to parse
// these language tags. Some duplicates have been removed.
'af': 'Afrikaans',
'af-ZA': 'Afrikaans (South Africa)',
'ar': 'Arabic',
'ar-AE': 'Arabic (U.A.E.)',
'ar-BH': 'Arabic (Bahrain)',
'ar-DZ': 'Arabic (Algeria)',
branneman /
Last active June 12, 2024 02:40
Better local require() paths for Node.js

Better local require() paths for Node.js


When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions