Skip to content

Instantly share code, notes, and snippets.

On vacation

GuangGuang Guang1234567

On vacation
View GitHub Profile
Guang1234567 / trap.swift
Created Aug 25, 2021 — forked from sharplet/trap.swift
Simple signal handling in Swift
View trap.swift
import Darwin
enum Signal: Int32 {
case HUP = 1
case INT = 2
case QUIT = 3
case ABRT = 6
case KILL = 9
case ALRM = 14
case TERM = 15
Guang1234567 / trace.swift
Created Aug 20, 2021 — forked from harlanhaskins/trace.swift
Pure Swift stack trace
View trace.swift
struct StackFrame {
let symbol: String
let file: String
let address: UInt64
let symbolAddress: UInt64
var demangledSymbol: String {
return _stdlib_demangleName(symbol)
Guang1234567 / build.gradle
Created Apr 20, 2021 — forked from nkraev/build.gradle
Variant-aware gradle configuration for replacing manifest placeholders and resources
View build.gradle
android.applicationVariants.all { variant ->
String propsName = "../local/${variant.baseName}.properties"
Properties props = new Properties()
props.load(new FileInputStream(file(propsName)))
println "Building \"${variant.baseName}\" tag..."
props.stringPropertyNames().forEach {
variant.resValue("string", it, props[it])
Guang1234567 / gh-check
Created Oct 14, 2020 — forked from lilydjwg/gh-check
gh-check: speed test to known GitHub IPs
View gh-check
import asyncio
import time
import socket
import argparse
import aiohttp
class MyConnector(aiohttp.TCPConnector):
Guang1234567 / trial.key
Created Feb 13, 2019 — forked from huqi/trial.key
Beyond Compare 4 license for Mac
View trial.key
Beyond Compare 4
Licensed to: ASIO Allsoftinone
Quantity: 1 user
Serial number: 1822-9597
License type: Pro Edition for Windows
Guang1234567 / use-bbdiff
Created Dec 15, 2017 — forked from wholmgren/use-bbdiff
set git difftool to bbdiff
View use-bbdiff
git config --global diff.tool bbdiff
git config --global difftool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"'
git config --global difftool.prompt false
git config --global merge.tool bbdiff
git config --global mergetool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"'
Double check ~/.gitconfig
Guang1234567 /
Last active May 19, 2017
RxBus2 is modified according to @YoKeyword's RxBus, but improve the part of handle java Exception.
// @yokeyword's Rxbus is here:
package com.example.myproduct.lib.common.utils.rx.eventbus;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import io.reactivex.Flowable;
import io.reactivex.processors.FlowableProcessor;
Guang1234567 /
Last active May 11, 2017
How to use **onErrorResumeNext** operator of Rxjava2 ?
RxView.clicks(mIvTestGlide) // 只发出 onNext 事件的事件源
.flatMap(new Function<Object, ObservableSource<Object>>() {
public ObservableSource<Object> apply(Object o) throws Exception {
// another observable which can throw onError.
return Observable.error(new Exception("模拟发生错误的地方!!!"))
.doOnError(new Consumer<Throwable>() {
public void accept(Throwable throwable) throws Exception {
// TODO : 由于下面的 onErrorResumeNext, 因此 error 事件无法传递到"订阅者 observer", 故需要在这里做处理.