Skip to content

Instantly share code, notes, and snippets.

😄
Working

JohnWatsonDev johnwatsondev

😄
Working
View GitHub Profile
View Sublime Text 3 cheating.md

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 Mar 15, 2019 — forked from lopspower/README.md
Hexadecimal color code for transparency
View README.md

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 Feb 11, 2019
Root phone and install Gapp
View Root phone and install Gapp.md

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 Jul 10, 2020
Customizing the DividerItemDecoration class so we can remove divider / decorator after the last item
View DividerItemDecoration.java
/*
* 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 Apr 11, 2018 — forked from jpardogo/build.gradle
Gradle DependecyResolution
View build.gradle
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 Mar 13, 2018
set jet brain server locally
View jetbrain.sh
#!/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 Dec 26, 2017 — forked from alexfu/EqualSpacingItemDecoration.java
Add equal spacing to RecyclerView items automatically. Can handle horizontal, vertical, and grid display modes
View EqualSpacingItemDecoration.java
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 Dec 26, 2017 — forked from heinrichreimer/SpanningGridLayoutManager.java
GridLayoutManager implementation that stretches to fit all grid items on screen and disables scrolling. Useful for dashboards etc.
View SpanningGridLayoutManager.java
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 {
@johnwatsondev
johnwatsondev / SpanningLinearLayoutManager.java
Created Dec 26, 2017 — forked from heinrichreimer/LICENSE
LinearLayoutManager implementation that stretches to fit all list items on screen and disables scrolling. Useful for dashboards etc.
View SpanningLinearLayoutManager.java
package de.wilhelmgym.quiz.recyclerview;
import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.ViewGroup;
public class SpanningLinearLayoutManager extends LinearLayoutManager {
You can’t perform that action at this time.