Skip to content

Instantly share code, notes, and snippets.

View 52cik's full-sized avatar

楼教主 52cik

View GitHub Profile
@52cik
52cik / npm.taobao.sh
Last active February 29, 2024 02:56
npm 淘宝镜像配置
npm set registry https://r.npm.taobao.org # 注册模块镜像
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像
npm set ELECTRON_MIRROR https://cdn.npm.taobao.org/dist/electron/ # electron 二进制包镜像
npm set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer 二进制包镜像
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver 二进制包镜像
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver 二进制包镜像
@52cik
52cik / docker-batch-pull.sh
Last active October 6, 2023 12:39
docker 镜像批量更新
for i in $( docker images --format "{{.Repository}}:{{.Tag}}" )
do
docker pull $i
done
# or
# docker images --format "{{.Repository}}:{{.Tag}}" | xargs -L1 docker pull
docker image prune -f
@52cik
52cik / address.js
Last active June 4, 2022 13:06
提取淘宝地址库
/**
* 提取淘宝地址库
*
* 用法:
* 1. 打开淘宝 https://www.taobao.com/
* 2. 将下面代码复制到控制台
* 3. 按回车
* 4. 复制输出的 json 数据保存到你的文件
*
* 仅支持: chrome 48+
@52cik
52cik / font-family.css
Created May 29, 2016 16:29
font-family 最优重置
/**
* 为了避免字体混乱的局面,Neat.css 统一了 font-family 的设置。
*
* 1. 中文字体选择如下:
* Windows 优先使用「微软雅黑」,如果没有则使用「中易宋体(SimSun)」。
* OS X 优先使用「冬青黑体简体(Hiragino Sans GB)」,如果没有则使用默认的「华文黑体」。
* Linux 优先使用「文泉驿微米黑」。
*
* 2. 西文字体选择如下:
* Windows 优先使用「Arial」。
@52cik
52cik / vue.config.js
Created April 10, 2020 14:10
vue config Component img src resolving - vue 自定义图片组件 src 解析配置
/** @type {import('@vue/cli-service').ProjectOptions} */
module.exports = {
chainWebpack(config) {
// https://bootstrap-vue.js.org/docs/reference/images/
// https://github.com/webpack-contrib/html-loader
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap((options) => {
@52cik
52cik / getUserIP.js
Last active September 27, 2019 15:17
getUserIP (Promise)
/**
* Get the user IP throught the webkitRTCPeerConnection
*
* @return {Promise<string>}
*
* @see Get the client IP address with Javascript on Safari {@link https://stackoverflow.com/questions/46925857/get-the-client-ip-address-with-javascript-on-safari}
*/
function getUserIP() {
//compatibility for firefox and chrome
var myPeerConnection =
@52cik
52cik / webkit.html
Last active April 26, 2018 03:41
浏览器webkit内核渲染
<!--360浏览器-->
<meta name="renderer" content="webkit">
<!--其它双核浏览器-->
<meta name="force-rendering" content="webkit">
<!--如果安装了GCF,则使用GCF来渲染页面,如果没有安装GCF,则使用最高版本的IE内核进行渲染。-->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
@52cik
52cik / nginx-yii2.conf
Created April 13, 2016 16:01
nginx yii2 通用配置
listen 80;
charset utf-8;
index index.html index.php;
error_page 404 /404.html;
# 开启 php 并支持 pathinfo
include enable-php-pathinfo.conf;
# yii2 rewrite
@52cik
52cik / git.txt
Created October 9, 2016 06:27
git 强行回退
假设你有3个commit如下:
commit 3
commit 2
commit 1
其中最后一次提交commit 3是错误的,那么可以执行:
git reset --hard HEAD~1
你会发现,HEAD is now at commit 2。