Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Adventuring

hyongbai hyongbai

💭
Adventuring
View GitHub Profile
View gist:7e5731e3462a5d238843a416da6992e8
[![PorterDuff-Mode.png](https://j.mp/3tK399i)](https://j.mp/39b6pmq)
View gist:0f4ad579de62705beaa807170eecf2e8
> Task :app:taskTree
------------------------------------------------------------
Project :app
------------------------------------------------------------
preBuild
preDebugBuild
compileDebugAidl
compileDebugRenderscript
@hyongbai
hyongbai / uploadArchives.gradle
Last active Jul 9, 2020
upload to maven center
View uploadArchives.gradle
allprojects[0].repositories.listIterator().toSet().forEach {
println("REPOSITORY: ${it.name} ${it.properties.get('url')}")
}
View backstack of js functions
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 / id_calculator.sh
Created Jun 29, 2019
中国身份证校验码计算公式
View id_calculator.sh
# 中国身份证校验码计算公式
# 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
View PmHostSvc.java
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;
//
View gist:498bc9e9358a6e2af86f3e72968308c3

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
@hyongbai
hyongbai / QHT.sol
Last active Oct 30, 2018
基于ETH发行Token
View QHT.sol
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);
View task.gradle
task hello(){
println("HELLO")
}
task deployReplugin {
println("deployReplugin")
}
deployReplugin.doLast {
println("deployReplugin.doLast")
View recursive.groovy
// 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 ->