Skip to content

Instantly share code, notes, and snippets.

View Guang1234567's full-sized avatar
🌴
On vacation

GuangGuang Guang1234567

🌴
On vacation
View GitHub Profile
@Guang1234567
Guang1234567 / onErrorResumeNext.java
Last active May 11, 2017 04:47
How to use **onErrorResumeNext** operator of Rxjava2 ?
RxView.clicks(mIvTestGlide) // 只发出 onNext 事件的事件源
.flatMap(new Function<Object, ObservableSource<Object>>() {
@Override
public ObservableSource<Object> apply(Object o) throws Exception {
// another observable which can throw onError.
return Observable.error(new Exception("模拟发生错误的地方!!!"))
.doOnError(new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
// TODO : 由于下面的 onErrorResumeNext, 因此 error 事件无法传递到"订阅者 observer", 故需要在这里做处理.
@Guang1234567
Guang1234567 / RxBus2.java
Last active May 19, 2017 07:34
RxBus2 is modified according to @YoKeyword's RxBus, but improve the part of handle java Exception.
// @yokeyword's Rxbus is here: https://github.com/YoKeyword/RxBus/blob/master/rxbus/src/main/java/me/yokeyword/rxbus/RxBus.java
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
Guang1234567 / use-bbdiff
Created December 15, 2017 07:43 — forked from wholmgren/use-bbdiff
set git difftool to 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
Guang1234567 / trial.key
Created February 13, 2019 04:00 — forked from huqi/trial.key
Beyond Compare 4 license for Mac
Beyond Compare 4
Licensed to: ASIO Allsoftinone
Quantity: 1 user
Serial number: 1822-9597
License type: Pro Edition for Windows
--- BEGIN LICENSE KEY ---
H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t
@Guang1234567
Guang1234567 / gh-check
Created October 14, 2020 02:37 — forked from lilydjwg/gh-check
gh-check: speed test to known GitHub IPs
#!/usr/bin/python3
import asyncio
import time
import socket
import argparse
import aiohttp
class MyConnector(aiohttp.TCPConnector):
@Guang1234567
Guang1234567 / build.gradle
Created April 20, 2021 09:09 — forked from nkraev/build.gradle
Variant-aware gradle configuration for replacing manifest placeholders and resources
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
Guang1234567 / trace.swift
Created August 20, 2021 04:56 — forked from harlanhaskins/trace.swift
Pure Swift stack trace
struct StackFrame {
let symbol: String
let file: String
let address: UInt64
let symbolAddress: UInt64
var demangledSymbol: String {
return _stdlib_demangleName(symbol)
}
}
@Guang1234567
Guang1234567 / trap.swift
Created August 25, 2021 04:06 — forked from sharplet/trap.swift
Simple signal handling in 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
Guang1234567 / README.md
Created July 27, 2022 03:52 — forked from subfuzion/README.md
vim/neovim configuration

I recently switched over to neovim (see my screenshots at the bottom). Below is my updated config file.

It's currently synchronized with my .vimrc config except for a block of neovim-specific terminal key mappings.

This is still a work in progress (everyone's own config is always a labor of love), but I'm already extremely pleased with how well this is working for me with neovim. While terminal mode isn't enough to make me stop using tmux, it is quite good and I like having it since it simplifies my documentation workflow for yanking terminal output to paste in a markdown buffer.

These days I primarily develop in Go. I'm super thrilled and grateful for fatih/vim-go,

@Guang1234567
Guang1234567 / related_url.txt
Last active December 23, 2022 02:51
Inheritance from an interface with '@JvmDefault' members is only allowed with -Xjvm-default option