Skip to content

Instantly share code, notes, and snippets.

View imtianx's full-sized avatar
🎯
Focusing

Xing imtianx

🎯
Focusing
View GitHub Profile
@imtianx
imtianx / build.yml
Created August 17, 2021 08:37 — forked from alexanderbazo/build.yml
Github Actions: Build and Release Android-APK
name: Minimal Android CI Workflow
on:
push:
branches:
- master
tags:
- 'v*'
jobs:
@imtianx
imtianx / actionlist.vim
Created April 13, 2020 13:44 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@imtianx
imtianx / TextViewExtensions.kt
Created July 23, 2019 07:42
TextWatcher dsl
@file:JvmName("TextViewExtensions")
package com.tongji.autoparts.extensions
import android.text.Editable
import android.text.TextWatcher
import android.widget.TextView
/**
* <pre>
@imtianx
imtianx / ConcurrencyHelpers.kt
Created July 10, 2019 02:59 — forked from objcode/ConcurrencyHelpers.kt
Helpers to control concurrency for one shot requests using Kotlin coroutines.
import kotlinx.coroutines.CoroutineStart.LAZY
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.async
import kotlinx.coroutines.cancelAndJoin
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import kotlinx.coroutines.yield
import java.util.concurrent.atomic.AtomicReference
import kotlin.DeprecationLevel.ERROR
@imtianx
imtianx / EventObserver.kt
Created June 10, 2019 08:46 — forked from JoseAlcerreca/EventObserver.kt
An Observer for Events, simplifying the pattern of checking if the Event's content has already been handled.
/**
* An [Observer] for [Event]s, simplifying the pattern of checking if the [Event]'s content has
* already been handled.
*
* [onEventUnhandledContent] is *only* called if the [Event]'s contents has not been handled.
*/
class EventObserver<T>(private val onEventUnhandledContent: (T) -> Unit) : Observer<Event<T>> {
override fun onChanged(event: Event<T>?) {
event?.getContentIfNotHandled()?.let { value ->
onEventUnhandledContent(value)
/*可任意修改样式,或恢复预设值,保存后生效
相对“默认样式”而作的修改会用 红色 标注*/
.output_wrapper/*此属性为全局*/
{
font-size: 16px;
color: #3e3e3e;
line-height: 1.6;
word-spacing:0px;
@imtianx
imtianx / add_prefix.sh
Created May 22, 2019 13:38
Batch modify the file name to add a prefix.
#!/usr/bin/env bash
SAVE_IFS=$IFS
IFS=$'\n'
files=$(ls -1 *.md)
file_prefix='ignore_pinyin_'
for file_name in ${files};do
@imtianx
imtianx / imtianx.github.io-.github-ci.yml
Created April 24, 2019 01:13
gitlab-ci config of the [imtianx.github.io](https://github.com/imtianx/imtianx.github.io) repo .
# https://hub.docker.com/r/library/node/tags/
image: node:latest
stages:
- build
- deploy
before_script:
- npm install hexo-cli -g
@imtianx
imtianx / Jetbrains-Idea-active-code.txt
Last active January 21, 2019 09:57
the active code of jetbrains Idea using Edu email. Active until 2019.8.15
H3VSC5I7YU-eyJsaWNlbnNlSWQiOiJIM1ZTQzVJN1lVIiwibGljZW5zZWVOYW1lIjoiWWFuIFhpIiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpbCI6IiIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ugb25seSIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiSUkiLCJwYWlkVXBUbyI6IjIwMTktMDgtMTQifSx7ImNvZGUiOiJSUzAiLCJwYWlkVXBUbyI6IjIwMTktMDgtMTQifSx7ImNvZGUiOiJXUyIsInBhaWRVcFRvIjoiMjAxOS0wOC0xNCJ9LHsiY29kZSI6IlJEIiwicGFpZFVwVG8iOiIyMDE5LTA4LTE0In0seyJjb2RlIjoiUkMiLCJwYWlkVXBUbyI6IjIwMTktMDgtMTQifSx7ImNvZGUiOiJEQyIsInBhaWRVcFRvIjoiMjAxOS0wOC0xNCJ9LHsiY29kZSI6IkRCIiwicGFpZFVwVG8iOiIyMDE5LTA4LTE0In0seyJjb2RlIjoiUk0iLCJwYWlkVXBUbyI6IjIwMTktMDgtMTQifSx7ImNvZGUiOiJETSIsInBhaWRVcFRvIjoiMjAxOS0wOC0xNCJ9LHsiY29kZSI6IkFDIiwicGFpZFVwVG8iOiIyMDE5LTA4LTE0In0seyJjb2RlIjoiRFBOIiwicGFpZFVwVG8iOiIyMDE5LTA4LTE0In0seyJjb2RlIjoiR08iLCJwYWlkVXBUbyI6IjIwMTktMDgtMTQifSx7ImNvZGUiOiJQUyIsInBhaWRVcFRvIjoiMjAxOS0wOC0xNCJ9LHsiY29kZSI6IkNMIiwicGFpZFVwVG8iOiIyMDE5LTA4LTE0In0seyJjb2RlIjoiUEMiLCJwYWlkVXBUbyI6IjIwMTktMDgtMTQifSx7ImNvZGUiOiJSU1UiL
@imtianx
imtianx / HttpsUtils.java
Last active October 29, 2018 09:35
HttpsUtils.kt
package cn.imtianx.common.net;
import android.annotation.SuppressLint;
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;