Skip to content

Instantly share code, notes, and snippets.

View Jayin's full-sized avatar

Jayin Tang Jayin

  • None
  • Guangzhou,China
  • 12:27 (UTC +08:00)
  • X @rover_tang
View GitHub Profile
@Jayin
Jayin / icon_select.js
Last active February 20, 2021 06:46
筛选出icon的名称
// 使用方法:在页面注入jquery 然后对应平台控制台中输入下面代码
// NO.1 Element icon 名字筛选
// 从页面 https://element.eleme.cn/2.13/#/zh-CN/component/icon 中注入执行
var iconNames = []
var iconElements = $('.icon-list li span.icon-name')
iconElements.each(function(index){
iconNames.push(iconElements[index].innerText)
})
@Jayin
Jayin / txc_webhook.php
Created June 23, 2020 06:18
腾讯兔小巢 webhook 转发消息到企业微信群机器人示例
<?php
// https://txc.qq.com webhook 转发到企业微信机器人
// 注意:请检查是否有配置IP白名单
// 群机器人URL
$worker_webhook_url = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxxxx';
$input_log = '_txc_input.log';
$output_log = '_txc_output.log';
@Jayin
Jayin / drak_mode.css
Created June 8, 2020 16:06
网站暗黑模式CSS
/* source: https://francoisbest.com/posts/2020/dark-mode-for-excalidraw */
.excalidraw.light {
filter: none;
}
/* simple */
.excalidraw.dark {
filter: invert(100%);
@Jayin
Jayin / gist:9d9697d92640959eef0d095e17ae50ba
Created December 10, 2019 09:01 — forked from srsbiz/gist:8373451ed3450c0548c3
php AES-128-CBC mcrypt & openssl
<?php
function encrypt_mcrypt($msg, $key, $iv = null) {
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
if (!$iv) {
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
}
$pad = $iv_size - (strlen($msg) % $iv_size);
$msg .= str_repeat(chr($pad), $pad);
$encryptedMessage = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $msg, MCRYPT_MODE_CBC, $iv);
return base64_encode($iv . $encryptedMessage);
@Jayin
Jayin / weixin.html
Created January 6, 2018 01:33
跳转微信出微信外部APP的演示
<!DOCTYPE html>
<html lang="zh-cmn-hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
<title>正在打开资源,请稍候……</title>
</head>
<body>
</body>
@Jayin
Jayin / visitDuration.js
Last active March 11, 2016 12:03
统计当前页面访问的duration
var pf = window.webkitPerformance ? window.webkitPerformance : window.msPerformance;
pf = (pf ? pf : window.performance);
function sendVisitDuration() {
var pfTime = pf ? pf.timing.domComplete : nowTime;
var time = new Date().getTime() - pfTime;
time = Math.ceil(time / 1000);
if (time > 0) {
var category = '0-2s';
if (time > 2 && time < 5) {
@Jayin
Jayin / Android-open-WeChat-App.java
Created November 19, 2015 06:13
Android第三方打开应用
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
/**
* Author: jayin
* Date: 11/19/15
*/
public class AppManager {
/**
@Jayin
Jayin / add-alimirror.sh
Created October 15, 2015 12:58
为Ubuntu 添加阿里云镜像 方便国内加速使用 镜像地址:http://mirrors.aliyun.com/help/ubuntu
#!/bin/bash
SOURCES_FILE=/etc/apt/sources.list
#back up
cp /etc/apt/sources.list /etc/apt/sources.list.backup
# 在原来的sources.list前插入阿里云的镜像链接
echo 'deb http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse' '\r\n' \
'deb http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse' '\r\n' \
@Jayin
Jayin / install-linuxbrew.sh
Created October 15, 2015 12:17
linux 系列:install linuxbrew
#!/bin/bash
RC= ~/.bashrc
sudo apt-get update
sudo apt-get install build-essential curl git m4 ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev
# install linuxbrew
git clone https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew
@Jayin
Jayin / install_php7.sh
Last active October 13, 2015 06:42
php7安装脚本-with Ningx MySQL ref: http://php.net/manual/zh/install.unix.nginx.php
# install dependency
apt-get install libxml2 libxml2-dev
# download
cd /tmp
wget https://downloads.php.net/~ab/php-7.0.0RC4.tar.xz
tar zxvf php-7.0.0RC4.tar.xz
cd php-7.0.0RC4
# install