Skip to content

Instantly share code, notes, and snippets.

View alfredhot's full-sized avatar
🖥️
I may be slow to respond.

Alfred.D.Cui alfredhot

🖥️
I may be slow to respond.
View GitHub Profile
import React from 'react'
export class CategoryLayout extends React.Component<any, any> {
constructor(props) {
super(props);
this.state = {
selectedItem: 'con1layout1'
}
}
@alfredhot
alfredhot / tarFolder.sh
Created January 10, 2021 03:09
打包文件夹较多的路径
#!/bin/bash
#####################
# author: alfredhot
# date: 2021-01-10
# desc: 打包较大的文件夹. 路径下文件夹和文件过多, 在转移位置的时候很容易出问题, 一个文件出错将导致整个复制过程中断.
# 所以将路径下包含文件过多的文件夹打包(不将所有文件夹都打包是因为有些文件夹下文件并不多, 打包浪费时间, 将来使用的时候挨个文件夹解压将十分繁琐.)
######################
# FOLDER_ARR 装载的数组将包含空格, 所以分隔符临时换做\n
IFS=$'\n'
@alfredhot
alfredhot / load_cookie.rb
Created December 10, 2019 07:57
[watir, selenium 里cookie load时的错误] "Document is cookie-averse" #watir #selenium #cookie
@alfredhot
alfredhot / mouse_event_pass_through.css
Created November 11, 2019 08:22
让鼠标事件直接穿过position: absolute 的元素
pointer-events: none;
@alfredhot
alfredhot / fix_no_pip_when_install_python3.sh
Created July 17, 2019 06:18
There is no pip3 installed after installing python3 on Mac sometimes, and this is the correct answer
# this is the answer
brew install python3
brew postinstall python3
@alfredhot
alfredhot / repare_gray_files_in_harddist.sh
Created July 17, 2019 06:16
Clear Mac finder attribute
#!/bin/sh
echo `xattr -d -r com.apple.FinderInfo ./*`
db.influencers.aggregate([
{
$match: {ac: 1}
},
{
$project: {_id: 1}
},
{
$lookup: {
from: 'media',
@alfredhot
alfredhot / full-height.sass
Created May 17, 2017 02:13
[full-height]full-height-element(div) #tags: CSS, layout
.main-left
position: absolute
left: 0
top: 0
height: 100%
width: $base-width
background-color: #3d3c3c
color: #e1e1e1
&:before
content: ''
@alfredhot
alfredhot / 0_reuse_code.js
Created January 10, 2017 08:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@alfredhot
alfredhot / UseSweetAlert2.coffee
Created December 2, 2016 06:04
JavaScript 에서 sweetalert 을 쉽게 사용하기
$rootScope.showAlert= (content, type, fn) ->
if fn is null
fn = ->
null
if type is null
swal $rootScope.popup.title, content
.then fn
else
swal $rootScope.popup.title, content, type
.then fn