Skip to content

Instantly share code, notes, and snippets.

View liuliangsir's full-sized avatar
💻
Coding

流浪大法师 liuliangsir

💻
Coding
View GitHub Profile
@jonlabelle
jonlabelle / windows_to_unix_command_cheat_sheet.md
Last active December 9, 2024 04:18
Windows to UNIX Command Cheat Sheet

Windows to UNIX Command Cheat Sheet

Windows PowerShell has several transition aliases that allow UNIX and CMD users to use familiar command names in Windows PowerShell. The most common aliases are shown in the table below, along with the Windows PowerShell command behind the alias and the standard Windows PowerShell alias if one exists.

CMD Command UNIX Command PowerShell Command PowerShell Alias
dir ls Get-ChildItem gci
@kentcdodds
kentcdodds / README.md
Last active March 11, 2021 01:41
JavaScript Program Slicing with SliceJS
@nolanlawson
nolanlawson / chrome_54_nexus5.csv
Last active July 9, 2019 15:23
Updated "cost of small modules" benchmarks (30 October 2016)
100 modules
Bundler Load time (ms) Run time (ms) Total time (ms)
browserify 108.89 22.65 131.53
browserify-collapsed 152.89 23.82 176.71
webpack 150.33 18.05 168.38
rollup 129.54 7.73 137.27
closure 131.54 1.74 133.28
rjs 158.19 33.28 191.47
rjs-almond 160.03 7.35 167.38
1000 modules
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active March 7, 2025 05:00
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

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.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@yanqiw
yanqiw / RCTScrollView.m
Created October 5, 2016 06:50
React Native adopt to xcode 8
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "RCTScrollView.h"
@michaellihs
michaellihs / tmux-cheat-sheet.md
Last active June 2, 2025 00:52
tmux Cheat Sheet
@Rich-Harris
Rich-Harris / footgun.md
Last active March 9, 2025 06:13
Top-level `await` is a footgun

Edit — February 2019

This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:

  • TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't block sibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
  • In the wild, we're seeing (async main(){...}()) as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems
  • Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal, which you can read here.

I'll leave the rest of this document unedited, for archaeological

@bendc
bendc / supportsES6.js
Created August 25, 2016 08:05
Test if ES6 is ~fully supported
var supportsES6 = function() {
try {
new Function("(a = 0) => a");
return true;
}
catch (err) {
return false;
}
}();
@rmoorman
rmoorman / babelrc-vs-webpack-babel-loader-configuration.md
Created July 30, 2016 16:54
.babelrc vs webpack babel-loader configuration

Either you use .babelrc to specify environment specific settings (plugins or transforms for example) using the env key:

{
  "presets": ["es2015", "stage-0", "react"],
  "env": {
    "development": {
      "plugins": [
        ["transform-object-rest-spread"],
 ["transform-react-display-name"],
@zulhfreelancer
zulhfreelancer / nginx_port_8080_to_80.md
Last active March 3, 2023 08:03
How to change Nginx port 8080 to 80
  1. ssh root@IP_ADDRESS
  2. nano /etc/nginx/sites-enabled/default
  3. add this at the bottom of the file:
server {
        listen 80;
        listen [::]:80;

        server_name YOUR_DOMAIN_NAME_HERE;