Skip to content

Instantly share code, notes, and snippets.

View johnwatsondev's full-sized avatar
😐

JohnWatsonDev johnwatsondev

😐
  • 工厂
  • Hangzhou
View GitHub Profile
@johnwatsondev
johnwatsondev / README.md
Created May 7, 2021 09:58 — forked from maboloshi/README.md
[Mac下配置Aria2] #macOS #aria2

Mac下配置Aria2

安装和设置 Aria2

# 使用 Homebrew 安装 aria2
brew install aria2

# 创建配置文件aria2.conf和空对话文件aria2.session
mkdir ~/.aria2 && cd ~/.aria2
touch aria2.conf

Ref: https://gist.github.com/vertexclique/9839383

Important Note

Please use built-in Terminal.app (of Mac OS X) to type and rune the command, do not use another tool (like iTerm2).

Common step after enter run the patch command:

  • After run the commands, start new Sublime Text app, go to Main Menu > Help > Enter License. On the popup type in any text (example "a") and click Use Licence .
@johnwatsondev
johnwatsondev / README.md
Created March 15, 2019 07:16 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

@johnwatsondev
johnwatsondev / Root phone and install Gapp.md
Last active February 11, 2019 11:21
Root phone and install Gapp

Software

  1. TWRP --- Recovery

Install TWRP

adb reboot bootloader

fastboot flash recovery twrp-3.2.3-0-hammerhead.img
@johnwatsondev
johnwatsondev / DividerItemDecoration.java
Last active November 30, 2022 07:48
Customizing the DividerItemDecoration class so we can remove divider / decorator after the last item
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@johnwatsondev
johnwatsondev / build.gradle
Created April 11, 2018 13:45 — forked from jpardogo/build.gradle
Gradle DependecyResolution
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
boolean isMultidex = details.requested.name.contains('multidex')
if (details.requested.group == 'com.android.support' && !isMultidex){
details.useVersion lib_versions.support
}else if(isMultidex){
details.useVersion lib_versions.multidex
}
}
@johnwatsondev
johnwatsondev / jetbrain.sh
Created March 13, 2018 10:15
set jet brain server locally
#!/bin/sh
echo 'start jetbrain local server...'
cd '/DevelopPrograms/IntelliJIDEALicenseServer' && screen -dmS IntelliJIDEALicenseServer -d -m ./IntelliJIDEALicenseServer_darwin_amd64 -p 1024 -u johnwatsondev
@johnwatsondev
johnwatsondev / EqualSpacingItemDecoration.java
Created December 26, 2017 14:11 — forked from alexfu/EqualSpacingItemDecoration.java
Add equal spacing to RecyclerView items automatically. Can handle horizontal, vertical, and grid display modes
import android.graphics.Rect;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
public class EqualSpacingItemDecoration extends RecyclerView.ItemDecoration {
private final int spacing;
private int displayMode;
public static final int HORIZONTAL = 0;
@johnwatsondev
johnwatsondev / SpanningGridLayoutManager.java
Created December 26, 2017 14:10 — forked from janheinrichmerker/SpanningGridLayoutManager.java
GridLayoutManager implementation that stretches to fit all grid items on screen and disables scrolling. Useful for dashboards etc.
package com.example;
import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.ViewGroup;
public class SpanningGridLayoutManager extends GridLayoutManager {