Skip to content

Instantly share code, notes, and snippets.

View hyongbai's full-sized avatar
💭
Adventuring

hyongbai hyongbai

💭
Adventuring
View GitHub Profile
// Way 1
def loadConfig; loadConfig = { p ->
if (p == null || !p.exists()) return
if (new File(p, "rp-config.gradle").exists()) apply from: "${p}/rp-config.gradle"
else loadConfig(p.parentFile)
}
loadConfig(buildscript.sourceFile.parentFile)
// Way2
def loadConfig = { p ->
task hello(){
println("HELLO")
}
task deployReplugin {
println("deployReplugin")
}
deployReplugin.doLast {
println("deployReplugin.doLast")
@hyongbai
hyongbai / QHT.sol
Last active October 30, 2018 06:46
基于ETH发行Token
pragma solidity ^0.4.23;
library Math {
function add(uint256 x, uint256 y) pure internal returns (uint256 z) {
assert((z = x + y) >= x);
}
function sub(uint256 x, uint256 y) pure internal returns (uint256 z) {
assert((z = x - y) <= x);
@hyongbai
hyongbai / gist:498bc9e9358a6e2af86f3e72968308c3
Created November 15, 2018 07:17 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
PmHostSvc:IPluginHost
=====================
@Override
public Map<String, List<String>> queryLocalBroadcasts(String action, boolean hostOnly) throws RemoteException {
if (LogDebug.LOG) {
LogDebug.d("IPluginHost", String.format("queryLocalBroadcasts(%s): >>>>>> ", action));
}
final long start = LogDebug.LOG ? System.currentTimeMillis() : 0;
//
@hyongbai
hyongbai / id_calculator.sh
Created June 29, 2019 17:02
中国身份证校验码计算公式
# 中国身份证校验码计算公式
# for more information: http://blog.sciencenet.cn/blog-408109-1075697.html
# 使用方法:
# `id_calculator ${身份证号码空格隔开}`
# 例如:
# ```
# $ id_calculator 1 1 0 1 0 0 2 0 0 1 0 9 1 0 8 2 9 1
# $ 求和 = 209, 余数 = 0, 校验码 = 1
function trace(count) {
var i = 0;
var caller = arguments.callee.caller;
count = count || 10;
while ((caller = caller.caller) && i++ < count) {
console.log(i+":"+caller.toString());
}
}
@hyongbai
hyongbai / uploadArchives.gradle
Last active July 9, 2020 08:09
upload to maven center
allprojects[0].repositories.listIterator().toSet().forEach {
println("REPOSITORY: ${it.name} ${it.properties.get('url')}")
}
> Task :app:taskTree
------------------------------------------------------------
Project :app
------------------------------------------------------------
preBuild
preDebugBuild
compileDebugAidl
compileDebugRenderscript
[![PorterDuff-Mode.png](https://j.mp/3tK399i)](https://j.mp/39b6pmq)