Skip to content

Instantly share code, notes, and snippets.

View hyousi's full-sized avatar
🎯
Focusing

zeked hyousi

🎯
Focusing
  • Chengdu, China
  • 15:55 (UTC +08:00)
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active March 9, 2025 10:50
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.
@robhrt7
robhrt7 / MySQL_5-7_macOS.md
Last active December 18, 2024 08:43 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@datchley
datchley / react-redux-style-guide.md
Last active September 12, 2024 04:07
React + Redux Style Guide
@ypan887
ypan887 / component.js
Last active August 13, 2020 01:41
react - disable submit button (es6)
export default class UploadComponent extends React.Component {
constructor() {
super();
this.state = {
title: '', // initial state for your input
desc: '',
image: ''
}
}
handleChange(e) {

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);