Skip to content

Instantly share code, notes, and snippets.

View grootfish's full-sized avatar
🎯
Focusing

Grootfish grootfish

🎯
Focusing
View GitHub Profile
@grootfish
grootfish / docker-aliases.sh
Created July 12, 2020 06:58 — forked from jgrodziski/docker-aliases.sh
Useful Docker Aliases
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #
# 利用ES6 Set去重 (ES6中最常用)
function unique (arr) {
return [...new Set(arr)]
return Array.from(new Set(arr))
}
# 利用for嵌套for,然后splice去重(ES5中最常用)
function unique(arr){
for(var i=0; i<arr.length; i++){
for(var j=i+1; j<arr.length; j++){
@grootfish
grootfish / BrewFile
Last active June 27, 2020 02:53
init Mac BrewFile
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-drivers"
tap "homebrew/cask-fonts"
tap "homebrew/core"
tap "homebrew/services"
tap "romkatv/powerlevel10k"
# Shell extension to jump to frequently used directories
brew "autojump"
# Utilities for the ext2, ext3, and ext4 file systems
@grootfish
grootfish / application-out.txt
Created February 25, 2020 07:21
打开破解软件
sudo xattr -d com.apple.quarantine /Applications/xxxx.app
@grootfish
grootfish / ControlledInput.js
Last active June 4, 2020 11:35
JS Snippets
// 受控组件
function ControlledInput({
callback,
type = 'text',
disabled = false,
readOnly = false,
defaultValue,
placeholder = ''
}) {
const [value, setValue] = React.useState(defaultValue);
@grootfish
grootfish / 3-title-laylout.css
Last active February 23, 2020 12:26
CSS Snippets
.tiles {
width: 900px;
font-size: 0;
}
.tile {
width: calc(900px / 3);
display: inline-block;
}
@grootfish
grootfish / formText.js
Last active March 25, 2020 07:59
React sheet
import React, { Component } from 'react';
export default class FormText extends Component {
render() {
const { value, formatMethod = a => a, className, ...resetProps } = this.props;
return <span className={typeof className === 'function' ? className(value) : className}{...resetProps}>{formatMethod(value) || '-'}</span>;
}
}