Skip to content

Instantly share code, notes, and snippets.

View flyfire's full-sized avatar
🎯
Focusing

flyfire flyfire

🎯
Focusing
View GitHub Profile
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
@flyfire
flyfire / mig
Created May 25, 2020 03:50 — forked from BenoitDuffez/mig
Parse migration failed exception (Android Room)
#!/bin/bash
# Clean up on exit
function finish {
rm -f expected found
}
trap finish EXIT
# How to parse JSON
JQ="jq --sort-keys"
@flyfire
flyfire / HowToUseActivity.kt
Created April 29, 2020 03:11 — forked from keima/HowToUseActivity.kt
LifecycleOwner implemented RecyclerView ViewHolder & Adapter (concept design)
import android.os.Bundle
import android.util.Log
import android.view.ViewGroup
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent
import app.keima.android.recyclerviewsandbox.databinding.ActivityMainBinding
@flyfire
flyfire / android_osx_setup.md
Created March 5, 2020 13:39 — forked from lbalmaceda/android_osx_setup.md
Mac OS X Environment Setup with Android

Mac OS X Environment Setup with Android

Every time I format the drive and perform a clean install of the SO, I end up searching for my favorite stuff. This file tries to sum up my setup.

Browser

Download Chrome.

Also install the latest JDK (Java Development Kit).

Text Editor

@flyfire
flyfire / capture_articles.py
Created February 9, 2020 07:15 — forked from 2019ncovmemory/capture_articles.py
Create screenshots of articles; work for WeChat articles with lazy loading.
'''
Usage: python archive_articles.py test.csv
Input: test.csv
name url
1 url1
2 url2
.....
output:
1.png
2.png
@flyfire
flyfire / git paging.md
Created October 9, 2019 02:47 — forked from hutusi/git paging.md
Git checkout next / prev commit

Treat git log as a book, exec git next or git prev to checkout the next or the previous commit.

import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.text.SpannableStringBuilder;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.TextView;
资源汇总
https://github.com/crazycodeboy/awesome-flutter-cn
控件汇总
https://github.com/alibaba/flutter-go
https://github.com/efoxTeam/flutter-ui
完整项目demo
https://github.com/Sky24n/flutter_wanandroid
https://github.com/CarGuo/GSYGithubAppFlutter
@flyfire
flyfire / current_activity.sh
Created September 17, 2019 13:57 — forked from 109021017/current_activity.sh
A shell script log the current android top activity
oldActvity=""
displayName=""
currentActivity=`adb shell dumpsys window windows | grep -E 'mCurrentFocus'`
while true
do
if [[ $oldActvity != $currentActivity && $currentActivity != *"=null"* ]]; then
displayName=${currentActivity##* }
displayName=${displayName%%\}*}
echo $displayName
oldActvity=$currentActivity
@flyfire
flyfire / gitproxy-socat
Created September 8, 2019 03:37 — forked from sit/gitproxy-socat
A simple wrapper around socat to use as a git proxy command
#!/bin/sh
# Use socat to proxy git through an HTTP CONNECT firewall.
# Useful if you are trying to clone git:// from inside a company.
# Requires that the proxy allows CONNECT to port 9418.
#
# Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run
# chmod +x gitproxy
# git config --global core.gitproxy gitproxy
#
# More details at http://tinyurl.com/8xvpny