Skip to content

Instantly share code, notes, and snippets.

View Gaubee's full-sized avatar
🫐
Growing

Gaubee Gaubee

🫐
Growing
View GitHub Profile
commit 7a78c009c4b073f90b97d9111b14ffd84662fb5e
Author: Gaubee <GaubeeBangeel@Gmail.com>
Date: Thu Dec 28 13:12:27 2023 +0800
:bug: [kmp/core] 修复IpcBodySender的from函数延迟赋值metaBody的问题
commit 40d88f0face4e374ffcae31992205fcda12e741f
Author: jackie-yellow <hl19081555@gmail.com>
Date: Thu Dec 28 09:45:23 2023 +0800

Install Android SDK CLI Ubuntu 20.04 WSL2 (Work in Progress)

Install Java 8

sudo apt install openjdk-8-jdk-headless

Android SDK

@Gaubee
Gaubee / bin2hex.js
Last active February 5, 2020 16:23
取代cookie的网站追踪技术:”帆布指纹识别”初探
function bin2hex (bin)
{
var i = 0, l = bin.length, chr, hex = '';
for (i; i < l; ++i)
{
chr = bin.charCodeAt(i).toString(16)
hex += chr.length < 2 ? '0' + chr : chr
}
return hex
}

解决 Git 在 windows 下中文乱码的问题

原因

中文乱码的根源在于 windows 基于一些历史原因无法全面支持 utf-8 编码格式,并且也无法通过有效手段令其全面支持。

解决方案

  1. 安装
@Gaubee
Gaubee / mind-pact.js
Last active August 8, 2018 07:15
Mind Pact.JS——JS的灵魂契约
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['MP'], factory);
} else {
root.MP = factory(root.b);
}
}(this, function(__global) {
var QuotedString = /"(?:\.|(\\\")|[^\""\n])*"|'(?:\.|(\\\')|[^\''\n])*'/g, //引号字符串
$NULL = null,
$UNDEFINED,
@Gaubee
Gaubee / account.chain.ts
Last active May 18, 2018 08:42
使用数组来链式记录账户的余额
import { MongoClient } from 'mongodb';
const url = 'mongodb://localhost:27017';
const dbName = 'test-set';
import { ConsolePro } from "console-pro";
const console = new ConsolePro();
/**等待n毫秒 */
function sleep(ms: number) {
return new Promise(cb => setTimeout(cb, ms));
}
@Gaubee
Gaubee / remove-term-color.js
Created May 16, 2018 09:56
remove terminal color.
const color_flag_reg = /((\u001b\[\d+m)+)([\s\S]+?)((\u001b\[\d+m)+)/;
s.replace(color_flag_reg, "$3");
@Gaubee
Gaubee / node_alipay.js
Created June 22, 2014 08:19
nodejs·支付宝·即时到帐接口
/* *
*类名:AlipayConfig
*功能:基础配置类
*详细:设置帐户有关信息及返回路径
*版本:3.2
*日期:2011-03-17
*说明:
*以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。
*该代码仅供学习和研究支付宝接口使用,只是提供一个参考。
@Gaubee
Gaubee / gist:5013908
Last active March 1, 2018 03:04
javascript继承复写原型链函数的this._super()实现调用原函数(ES3版)
log = console.log;
var c = function(){};
c.create = function( Config ){
var newFn = function(){
//return newFn;
};
newFn.prototype = new c;
var fn = c.prototype;
for (var i in Config)
@Gaubee
Gaubee / gist:5014033
Last active March 1, 2018 03:04
javascript(ES3)实现闭包共享(namespace 简单版,可分文件编辑,并整合输出,不污染全局变量),通过闭包实现。 注:Compression函数用于提取代码中的变量。由于JS无块作用域,Compression并不提取块作用域中的变量,为了简化代码,也算是一个Bug。
var log = console.log;
//泳衣格式化代码的正则表达式
var reg = {
DoubleQuotedString : new RegExp('"(?:\\.|(\\\\\\")|[^\\""\\n])*"','g'),//双引号字符串
SingleQuotedString : new RegExp("'(?:\\.|(\\\\\\')|[^\\''\\n])*'",'g'),//单引号字符串
Chars : new RegExp('([(=[{])','g'),//需用空格隔开的字符(用以逻辑判断代码规则)
Empty : new RegExp('[ ]+','g'),//空字符
MultiLineCComments : new RegExp('/\\*[\\s\\S]*?\\*/', 'gm'),//多行注释
SingleLineCComments : new RegExp('//.*$', 'gm'),//单行注释
}