Skip to content

Instantly share code, notes, and snippets.

View lijunencode's full-sized avatar

大力 lijunencode

View GitHub Profile
/**
* genpac 2.1.0 https://github.com/JinnLynn/genpac
* GFWList Last-Modified: 2020-09-23 21:57:31
*/
var proxy = 'SOCKS5 127.0.0.1:7891';
var rules = [
[
[],
[]
@lijunencode
lijunencode / unset_proxy.sh
Last active August 20, 2020 18:44
取消代理
#! /bin/bash
# alias proxy-unset='source ~/.proxy/unset_proxy.sh'
HTTP_PROXY=$(env | grep 'http_proxy' | grep -v 'grep' | wc -l)
HTTPS_PROXY=$(env | grep 'https_proxy' | grep -v 'grep' | wc -l)
ALL_PROXY=$(env | grep 'all_proxy' | grep -v 'grep' | wc -l)
# set http_proxy
if [ $HTTP_PROXY -ne 0 ]
then
unset http_proxy
@lijunencode
lijunencode / set_proxy.sh
Created August 20, 2020 18:43
设置代理
#! /bin/bash
# alias proxy-set='source ~/.proxy/set_proxy.sh'
HTTP_PROXY=$(env | grep '\bhttp_proxy\b' | grep -v 'grep' | wc -l)
HTTPS_PROXY=$(env | grep '\bhttps_proxy\b' | grep -v 'grep' | wc -l)
ALL_PROXY=$(env | grep '\ball_proxy\b' | grep -v 'grep' | wc -l)
# set http_proxy
if [ $HTTP_PROXY -eq 0 ]
then
export http_proxy=http://192.168.50.116:7890
@lijunencode
lijunencode / function.php
Last active March 3, 2021 07:01
debug 打印函数
if (!function_exists('p')) {
function p($var, $format = false) {
$print = var_export($var, true);
if ($format)
$print = '<pre><div style="background-color: #fafafa; padding: 10px;">'
. 'TYPE: ' .gettype($var) . '<hr>'
. $print . '</div></pre>';
die($print);
@lijunencode
lijunencode / .git-commit-template
Last active August 13, 2020 13:19
git commit template ( 优雅的提交你的git commit)
<type>(<scope>):<subject>
# commit message style
#
# [sample]
#
# - fix(DAO):用户查询缺少username属性
# - feat(Controller): 用户查询接口开发
#
# [字段说明]
@lijunencode
lijunencode / clash.yaml
Last active August 13, 2020 06:16
[国内]开启代理后, windows应用商店, 便笺等应用程序无法连接网路
# 取消以下host的代理, 或者修改direct模式
- '*.microsoft.com'
- '*.live.com'
- '*.outlook.com'
- '*.windows.com'
- '*.onedrive.com'
- 'store-images.s-microsoft.com'
/**
* [手机号码合法性验证]
* @param string $mobile
* return boolean
*/
if (!function_exists('mobile_validate')) {
function mobile_validate($mobile) {
if (empty($mobile)) {
return false;
/**
| ----------------------------------------------------------------------------------------------
| [参数空值验证 Usage: args_validate($var1 [, $var2] [... , $vars]) or args_validate(func_get_args)]
| [单个参数为数组时,则会判断数组中的每个元素, 如果参数数量大于1, 则不会判断数组类每个元素]
| ----------------------------------------------------------------------------------------------
*
* @param mixed ...$args
* @return boolean
*/
if (!function_exists('args_validate')) {
/**
* [生成随机字符串]
* @param integer $type 字符类型 0: 数字; 1: 小写字母; 2: 大写字母; 3: 混合字符(默认)
* @param integer $len 字符长度 默认长度为4个字符
* @return string
*/
if (!function_exists('create_code')) {
function create_code($type = 3, $len = 4) {
$type = (int)$type;
<style type="text/css">
body, html {
margin: 0;
padding: 0;
font-family: 'Quicksand' !important;
font-weight: bold !important;
color: white !important;
}
.center {
background-color: rgba(30, 30, 30, 1) !important;