Skip to content

Instantly share code, notes, and snippets.

View 52cik's full-sized avatar

楼教主 52cik

View GitHub Profile
@52cik
52cik / post-receive.sh
Created January 13, 2017 06:39 — forked from icyleaf/post-receive.sh
git autodeploy script when it matches the string "[deploy]"
#!/bin/sh
#
# git autodeploy script when it matches the string "[deploy]"
#
# @author icyleaf <[email protected]>
# @link http://icyleaf.com
# @version 0.1
#
# Usage:
# 1. put this into the post-receive hook file itself below
@52cik
52cik / countDown.js
Created June 6, 2017 06:29
倒计时处理方法 (精确时间处理)
/**
* 倒计时处理方法 (精确时间处理)
*
* @param {Number} seconds 剩余秒数/时间戳
* @param {Function} callback 回调函数
* @param {Boolean} timeStamp 是否时间戳
*
* 使用例子
*
* // 情况1:后台给的是倒计时 秒
@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 / 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 / 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) => {