Skip to content

Instantly share code, notes, and snippets.

View BelinChung's full-sized avatar
🎯
Focusing

BelinChung BelinChung

🎯
Focusing
View GitHub Profile
@BelinChung
BelinChung / fis-conf.js
Last active July 30, 2018 14:54
fis config file for FIS3
/* global fis */
/**
* fis-conf.js for FIS3
* author: BelinChung
*
**/
fis.set('component.gitlab.token', 'FwUhAGn************');
@BelinChung
BelinChung / authcode.php
Created December 1, 2014 05:07
Discuz! 中的加解密函数
<?php
/**
* @param string $string 原文或者密文
* @param string $operation 操作(ENCODE | DECODE), 默认为 DECODE
* @param string $key 密钥
* @param int $expiry 密文有效期, 加密时候有效, 单位 秒,0 为永久有效
* @return string 处理后的 原文或者 经过 base64_encode 处理后的密文
*
**/
function authcode($string, $operation = 'DECODE', $key = '', $expiry = 3600)
@BelinChung
BelinChung / ua.js
Last active August 29, 2015 14:03
Mobile UA detection library.You can access device object which contains useful information about device and platform.
var device = (function () {
var device = {};
var ua = navigator.userAgent;
var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
device.ios = device.android = device.iphone = device.ipad = false;
@BelinChung
BelinChung / token.class.php
Last active August 11, 2023 08:17
REST API 中调用校验Token的生成与维护
<?php
class Token
{
private $mmc;
private $cache_time;
function __construct()
{
$this->cache_time = 60 * 60 * 24;