Skip to content

Instantly share code, notes, and snippets.

Bendy Zhang bndynet

Block or report user

Report or block bndynet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bndynet
bndynet / default.md
Last active May 17, 2019
JavaScript Unit Testing - Jest
View default.md

Important issues for Jest

Configurations for DOM Support

Use document object and methods like document.querySelectorAll...

_setup.ts

import "jsdom-global/register";
@bndynet
bndynet / default.md
Last active Apr 19, 2019
Spring Things
View default.md

Things to Know Getting Started With Spring...

Custom Error

Disabling the Whitelabel Error Page

S1: In application.properties server.error.whitelabel.enabled=false

S2: Excluding the ErrorMvcAutoConfiguration bean

@bndynet
bndynet / default.md
Created Apr 2, 2019
React/JSX Style Guide
View default.md

React/JSX Style Guide

A mostly reasonable approach to React and JSX

This style guide is mostly based on the standards that are currently prevalent in JavaScript, although some conventions (i.e async/await or static class fields) may still be included or prohibited on a case-by-case basis. Currently, anything prior to stage 3 is not included nor recommended in this guide.

Table of Contents

  1. Basic Rules
  2. Class vs React.createClass vs stateless
View default.md

Code for arrows in CSS

.arrow-left {
  display: inline-block;

  
  position: relative;
  width: 0; 
  height: 0; 
@bndynet
bndynet / default.md
Last active Jan 23, 2019
Use @semantic to release package to NPM and publish docs to gh-pages automatically
View default.md

Describe how to release package to NPM and publish gh-pages according to your commits automatically.

#awef

  1. Install requisite dependencies
# run local scripts for executing ts file for deploying docs
npm i -D @types/node
npm i -D ts-node
@bndynet
bndynet / default.md
Created Jan 16, 2019
How to package your React Component for distribution via NPM
View default.md

1. MAKE A PACKAGE NPM PUBLISHABLE

npm init

In the package.json, make sure these fields are populated: package.json

{
    "name": "myUnflappableComponent",
    "version": "0.0.29",
    "main": "dist/index.js",
@bndynet
bndynet / iterm2-solarized.md
Created Jan 15, 2019 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)
View iterm2-solarized.md

Default

Default

Powerlevel9k

Powerlevel9k

View github_oauth_busy_developer_guide.md

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access:
@bndynet
bndynet / react.md
Last active May 30, 2019
React Notes
View react.md

Notes for starting React

React

The Component Lifecycle

Mounting

These methods are called in the following order when an instance of a component is being created and inserted into the DOM:

  • constructor()
View myisam-vs-innodb.md

MyISAM和InnoDB都使用B+树来实现索引:

  • MyISAM的索引与数据分开存储

  • MyISAM的索引叶子存储指针,主键索引与普通索引无太大区别

  • InnoDB的聚集索引和数据行统一存储

  • InnoDB的聚集索引存储数据行本身,普通索引存储主键

You can’t perform that action at this time.