首页经验笔记列表
  • Linux给Zip压缩包添加自定义注释

    zipfilename.zip-z然后会叫你输入内容先输入注释然后回车另起一行输入.Shell脚本实现,保存为:do_zipm:#!/bin/bashf=$1z=$2echo"${f}${z}"zip${f}-z
  • Nginx if多重判断 指定域名强制Https

    set$tag0;if($server_port!~443){set$tag"${tag}1";}if($host="baidu.com"){set$tag"${tag}1";}if($tag="011"){rewrite^(/.*)$https://$host$1permanent;}
  • Linux cenots 修改yum为国内源

    cd/etc/yum.repos.d/rm-fCentOS-Base.repoCentOS-AppStream.repoCentOS-PowerTools.repoCentOS-centosplus.repoCentOS-Extras.repocurl-oCentOS-Base.repohttps://mirrors.aliyun.com/repo/Centos-8.repoyummakecach…
  • Python3 Linux Cenots 安装Talib

    指令:yuminstallgccgcc-c++-yyuminstallpython36-devel-ysudowgethttp://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gztar-zxvfta-lib-0.4.0-src.tar.gzcdta-lib/sudo./configure--prefix=/usrsudomake…
  • Python3 获取小数位数 删除小数尾部0

    今天做获取小数位数的时候遇到了两个坑浮点数尾部0也计入了用float或者format把尾部0清除太小的数会变成科学计数下面我的解决方法importredefWeiShu(val):val_str=str(val)if"."notinval_str:return0#删除尾部0,float不行,会科学计数rgx=re.compile(r'(?:(\.)|(\.\d*?[1-9]\d*?))0+(?=\…
  • Layer tips实时悬浮显示隐藏

    引用:HTML:JS:$('span').on({mouseenter:function(){varthat=this;varnei=$(this).attr("tan");if(nei){tips=layer.tips(""+nei+"",that,{tips:[2,'#fff'],time:0,area:'auto',maxWidth:500});}},mouseleave:function(…
  • 【JS图片阅览器】安装使用Viewer.js 并用JS让Viewer.js显示图片

    1.下载Viewer.js官网下载地址:https://fengyuanchen.github.io/viewerjs/网盘下载地址:https://zijieyunpan.com/E8f4Vo1Z4iK2.安装引用文件(需先引用jquery,然后放在jquery的后面)给图片加入class属性:viewer如图:JS启用插件$('.viewer').viewer();然后点击图片即可查看效果~3…
  • 让Emlog Pro版本后台编辑器editor.md支持图片粘贴、拖拽上传

    1.前言今天搭建了个博客,发现后台文章编辑器居然图片不支持粘贴上传,mmp,马上开干~2.修改/admin/views/article_write.php文件打开文件然后文件末尾添加以下代码(上传图片函数)functioninitPasteDragImg(Editor){vardoc=document.getElementById(Editor.id)doc.addEventListener('p…
  • php 设置关闭浏览器后session也生效

    第一步:php.ini设置cookie_lifetime默认为0,代表关闭浏览器就失效单位为秒数,例子:6048007天后失效第二步:php.ini设置gc_maxlifetime默认为24分钟,session有效时间单位为秒数,例子:6048007天后失效