2021-03-14
最近在 Mac 上使用 Telegram 时,发现无法正常连接,无论是 PAC 还是全局均无效,在 Google 之后大多数答案都是 Windows 下的处理方法,并不适用。 以下教程的前提是 Mac 配置了 ShadowsocksX-NG,开启后,浏览器可正常访问 Googl
2021-03-08
众所周知,Windows 系统在安装完成之后,第一步就是激活系统,网上的一些激活方法大多数都是 KMS 激活,激活持续时间为半年,关于 KMS 激活方式,之前已经给大家介绍过几种方法: Windows 10 Business Editions 专业版在线激活密钥以及 Microsoft Office
2021-03-02
利用 label 的 for 属性绑定 checkbox,此方法对按钮与盒子的层级关系没有限制(需用到 CSS3 选择器) <style> ul,li{ list-style: none; } *{ padding: 0; margin: 0; } .nav-con{ display: none; } .nav-box{ display: none; } .nav-con:checked ~ .nav-box{ display: block; } .nav-btn{ padding: 10px 15px; background:; } </style> <label for="control" class="nav-btn
2021-02-22
由于不想多引入一个 jquery,百度了一个原生 js 实现 ajax 的方法(超简单),挺不错的,现在就分享给大家,也给大家做个参考。 首先新建一个 js 文件: function ajax(){ var ajaxData = { type:arguments[0].type || "GET", url:arguments[0].url || "", async:arguments[0].async || "true", data:arguments[0].data || null, header:arguments[0].header || {"Content-Type":"application/x-www-form-urlencoded"}, dataType:arguments[0].dataType || "text", beforeSend:arguments[0].beforeSend || function(){}, success:arguments[0].success || function(){}, error:arguments[0].error
2021-02-20
PHP 实现的简单在线人数统计功能 代码 //在线人数 function online_users() { $filename='online.txt'; $CookieName='OnLinePerson'; $onlineTime=30; $online=file($filename); $nowtime=$_SERVER['REQUEST_TIME']; $nowonline=array(); foreach($online as $line){ $row=explode('|',$line); $sesstime=trim($row[1]); if(($nowtime - $sesstime)<=$onlineTime){ $nowonline[$row[0]]=$sesstime; } } if(isset($_COOKIE[$CookieName])){ $uid=$_COOKIE[$CookieName]; }else{ $vid=0; do{ $vid++; $uid='U'.$vid; }while(array_key_exists($uid,$nowonline)); setcookie($CookieName,$uid); } $nowonline[$uid]=$nowtime; $total_online=count($nowonline); if($fp=@fopen($filename,'w')){ if(flock($fp,LOCK_EX)){ rewind($fp); foreach($nowonline as $fuid=>$ftime){ $fline=$fuid.'|'.$ftime."\n"; @fputs($fp,$fline); } flock($fp,LOCK_UN); fclose($fp); } } echo "$total_online"; } 这里解释下一些变量吧: $filename 数据文件的名字 $CookieName Cookie 名称,这里使用 Cookie 进
2021-02-05
github 上的小猫咪黑夜模式切换很可爱,想要~ 。于是花了点时间扒了下来放在了自己的博客上。 秉着开源精神,将源码分享给大家。 废话少说,上代码 html: <!-- 暗黑模式 --> <div class="profile-color-modes js-promo-color-modes-banner-profile"> <svg aria-hidden="true" height="45" viewBox="0 0 106 60" fill="none" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"> <g class="profile-color-modes-illu-group profile-color-modes-illu-red"> <path d="M37.5 58.5V57.5C37.5 49.768 43.768 43.5 51.5 43.5V43.5C59.232 43.5 65.5