Skip to content

Instantly share code, notes, and snippets.

View mcattx's full-sized avatar
🎯
learning

mcattx mcattx

🎯
learning
View GitHub Profile
@mcattx
mcattx / get_cpu_mem_info.sh
Created March 20, 2020 03:39
get_cpu_mem_info.sh
#!/bin/bash
#When the free memory very less ,this script to collect CPU/memory usage information and dmessage information.
#Version 1.0 time:2014-3-11
#Version 2.0 time:2014-12-23
logfile=/tmp/$0.log
check_os_release()
{
while true
@mcattx
mcattx / download.js
Created August 26, 2019 06:24
浏览器下载
download(name, data) {
const urlObject = window.URL || window.webkitURL || window;
const exportBlob = new Blob([data]);
const MIME_TYPE = 'text/plain'
const a = document.createElement('a');
a.download = name;
a.href = window.URL.createObjectURL(exportBlob);
a.textContent = 'Download ready';
a.dataset.downloadurl = [MIME_TYPE, a.download, a.href].join(':');
a.click();
@mcattx
mcattx / verify.js
Created April 1, 2019 09:48
纯前端图形验证码
class Verify {
constructor(options = {}) {
this.defaultConfig = {
id: '',
canvasId: 'verifyCanvas',
width: '100',
height: '30',
// 默认 blend - 数字字母混合类型, number - 纯数字, letter 纯字母
type: 'blend',
code: ''
@mcattx
mcattx / webpack.config.js
Created March 15, 2018 14:08
[webpack4 配置] #JavaScript #JS
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const TARGET = process.env.npm_lifecycle_event;
const buildImagePath = TARGET === 'build' ? '../../images/sabi/[name].[ext]' : 'images/[name].[ext]'
const config = {
@mcattx
mcattx / circle.css
Created March 13, 2018 08:15
[CSS 圆环倒计时] #css #css动画效果
.circle_process{
position: relative;
width: 199px;
height : 200px;
}
.circle_process .wrapper{
width: 100px;
height: 200px;
position: absolute;
top:0;
@mcattx
mcattx / pulse.css
Created February 24, 2018 13:11
涟漪波纹按钮 #css
/*<button></button>*/
button {
width: 59px;
height: 59px;
border: 1px solid #eee;
border-radius: 100%;
background-color: #fff;
cursor: pointer;
}
@mcattx
mcattx / bubbles.css
Created February 24, 2018 10:40
CSS 动画实现动态气泡背景 #css
.bg-bubbles {
position: absolute;
// 使气泡背景充满整个屏幕;
top: 0;
left: 0;
width: 100%;
height: 100%;
// 如果元素内容超出给定的宽度和高度,overflow 属性可以确定是否显示滚动条等行为;
overflow: hidden;
li {
@mcattx
mcattx / beacon.html
Last active February 24, 2018 06:22
呼吸光环 #css #css效果
<div class="pulsating-beacon">
<div class="beacon-static"></div>
<div class="beacon-pulse"></div>
</div>
<style>
.pulsating-beacon {
display: inline-block;
width: 40px;
height: 40px;
@mcattx
mcattx / .vimrc
Created February 7, 2018 12:37
vim config file
"------------------------------------------------------------------------
" general
"------------------------------------------------------------------------
set history=50 " 历史记录条数
"set number " 显示行号
set confirm " 在处理未保存或只读文件时,弹出确认提示
"------------------------------------------------------------------------
" colors
"------------------------------------------------------------------------
@mcattx
mcattx / jQuery-plugin-authoring.md
Created December 27, 2017 02:49 — forked from quexer/jQuery-plugin-authoring.md
如何编写 jQuery 插件

创建插件


看来 jQuery 你已经用得很爽了,想学习如何自己编写插件。非常好,这篇文档正适合你。用插件和方法来扩展 jQuery 非常强大,把最聪明的功能封装到插件中可以为你及团队节省大量开发时间。

开始