Skip to content

Instantly share code, notes, and snippets.

@justforuse
justforuse / show-all-spaces.css
Created January 11, 2017 10:09
Angular UI-Grid display multiple spaces as a space
.ui-grid-cell-contents {
white-space: pre !important;
}
@justforuse
justforuse / gist:a5b99e7b2ec94f84a521eac5cceecd49
Last active October 10, 2018 06:24
Element table render-header demo
<template>
<el-table>
<el-table-column
v-for='(column, index) in columns'
:key='index'
:label="column"
:render-header="renderHeader">
</el-table-column>
</el-table>
@justforuse
justforuse / generate-certificates.sh
Created August 1, 2019 14:37
Generate self-signed ssl certificates.
#!/bin/bash
# set values for certificate DNs
# note: CN is set to different values in the sections below
ORG="000_Test_Certificates"
# set values that the commands will share
VALID_DAYS=360
CA_KEY=ca.key
CA_CERT=ca.crt
@justforuse
justforuse / Terminal proxy(http & socks).md
Last active September 29, 2019 15:38
How to set terminal proxy
export http_proxy="http://127.0.0.1:1080"
export https_proxy="http://127.0.0.1:1080"


export http_proxy="socks5://127.0.0.1:1080"
export https_proxy="socks5://127.0.0.1:1080"


export ALL_PROXY=socks5://127.0.0.1:1080
@justforuse
justforuse / fire.md
Last active January 15, 2020 06:12
Save your code in one command in case of fire

How to quick save your code and upload to remote server in case of fire

Git version

  • Code

fire.sh

branch_name=`git config user.name`
git add .
@justforuse
justforuse / express.md
Last active February 17, 2020 14:40
Express cross origin headers
app.all('*', function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "X-Requested-With");
  res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
  res.header("X-Powered-By",' 3.2.1')
  res.header("Content-Type", "application/json;charset=utf-8");
  next();
});
@justforuse
justforuse / github.md
Created February 17, 2020 14:41
Github proxy when you can not access github

Add to your hosts

192.30.253.113    github.com
192.30.252.131 github.com
185.31.16.185 github.global.ssl.fastly.net
74.125.237.1 dl-ssl.google.com
173.194.127.200 groups.google.com
192.30.252.131 github.com
185.31.16.185 github.global.ssl.fastly.net
@justforuse
justforuse / a.md
Created April 2, 2020 13:07
Regular expression trim string spaces
// leading and trailing
reg = /\S.*\S/

// trailing
reg = /.*\S/

// leading
reg = /\S.*/
@justforuse
justforuse / hair.md
Last active April 8, 2020 16:07
Maintain your hair

一、菠菜菠菜在生发食物10强排行榜中是一种非常有营养价值的食物,它不仅对人体健康有着不错的功效,而且经过专业的认证分析菠菜其中的铁、锌这两种微量元素能迅速的促进身体的代谢,在配合其中的维生素A和维生素B成分,在生发效果上绝对会是相当不错的。

二、牡蛎谈到牡蛎相信会让不少人咽一下口水,其实它在针对脱发生发的作用上是相当不错的,它其中丰富的锌成分能及时的给予人体充足的而营养,而且它能生发的功效也得到了临床的认证,所以经常食用一点牡蛎会有着不错的生发和滋润头发的效果哟!

三、粗粮经常听人们说五谷杂粮是最能给人体提供营养的食物之一了,所以它其中的生素B族和铜等成分不仅是日常提升营养的佳品,而且经常食用粗粮能很好的促进体内自身的代谢和调节,坚持食用一段时间能达到不错的生发效果。

四、坚果坚果一类的食物在营养价值上都是相当高的,而且很多的坚果中的营养成分都是人体所必备的,同时坚果中独特的成分能很好的调节人体激素,促进毛囊细胞的分化,据研究表明经常吃坚果不仅能生发,同时还能利于人体长寿哟!

@justforuse
justforuse / list.md
Created October 9, 2019 06:42
npm registries
npm -----  https://registry.npmjs.org/
yarn ----- https://registry.yarnpkg.com
cnpm ----  http://r.cnpmjs.org/
taobao --  https://registry.npm.taobao.org/
nj ------  https://registry.nodejitsu.com/
skimdb -- https://skimdb.npmjs.com/registry