Skip to content

Instantly share code, notes, and snippets.

View Alex1990's full-sized avatar
🐢
Get Things Done!

Alex Chao Alex1990

🐢
Get Things Done!
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active November 17, 2024 22:07
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@markerikson
markerikson / redux-archeology-notes.md
Last active November 17, 2020 04:54
Redux Archeology and Design Notes

Design Goals

reduxjs/redux#8 (comment)

The main goal of this library is to prove that Flux can be implemented in a way compatible with full hot reloading (and explore how this can be done). You can run the example code with npm start, change action creators or stores, and the new logic will kick in before you refresh.

@alex-leonhardt
alex-leonhardt / main.go
Last active October 11, 2024 11:34
golang text/template with a map[string]interface{} populated from mixed json data
package main
import (
"encoding/json"
"os"
"reflect"
"text/template"
)
@axefrog
axefrog / suffix-tree-console.js
Last active May 6, 2024 05:17
Simple suffix tree implementation in JavaScript. Install chalk to run the script below, or strip it down and remove all the debug messages and test cases.
const defaultIfZero = (a, x) => x === 0 ? a : x;
const isDefined = x => x !== void 0;
const isUndefined = x => x === void 0;
const NONE = Symbol('NONE');
const chalk = require('chalk');
const val = x => (x === NONE ? (x = 'none', chalk.bold.grey) : chalk.cyan)(String(x));
let highlightActiveNode = null;
let highlightedEdges = [];
@simurai
simurai / README.md
Last active November 28, 2019 05:39
Atom for minimalists

For minimalist ❤️ ers

minimalist

Just you, your code and nothing else.... :meditatingbuddha:

anonymous
anonymous / config.json
Created October 15, 2016 17:58
Bootstrap Customizer Config
{
"vars": {
"@brand-primary": "#04a0c7",
"@brand-success": "#00b542",
"@brand-info": "#2155d9",
"@brand-warning": "#f3ac02",
"@brand-danger": "#f04b12",
"@border-radius-base": "0",
"@border-radius-large": "0",
"@border-radius-small": "0",
anonymous
anonymous / config.json
Created October 15, 2016 17:28
Bootstrap Customizer Config
{
"vars": {
"@brand-primary": "#04a0c7",
"@brand-success": "#00b542",
"@brand-info": "#2155d9",
"@brand-warning": "#e5a200",
"@brand-danger": "#f8290f",
"@border-radius-base": "0",
"@border-radius-large": "0",
"@border-radius-small": "0"
@tomysmile
tomysmile / mac-setup-redis.md
Last active October 31, 2024 21:46
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@nrollr
nrollr / Redis.sh
Created March 29, 2016 11:30
Install Redis via Homebrew
#!/bin/bash
brew install redis # Install Redis using Homebrew
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents # Enable Redis autostart
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist # Start Redis server via launchctl
# homebrew.mxcl.redis.plist contains reference to redis.conf file location: /usr/local/etc/redis.conf
redis-server /usr/local/etc/redis.conf # Start Redis server using configuration file, Ctrl+C to stop
redis-cli ping # Check if the Redis server is running
@maxim
maxim / gh-dl-release
Last active November 11, 2024 09:33
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#