Skip to content

Instantly share code, notes, and snippets.

View Android-PR-temp.txt
# Description, Motivation and Context
# Link to the resources (mockups, change description)
# What is the destination branch of this PR?
# How Has This Been Tested?
# Screenshots:
# Does this change require updates outside of the code, like updating the documentation, configuration? If so, was this done?
# Do reviewers should manually test your changes?
# Is the code testable? If not - why?
# Does similar functionality already exist in the codebase? If so, why isn’t this functionality reused?
# Checklist:
View deeplink.gradle
@SwiftyWang
SwiftyWang / util.java
Last active Sep 7, 2018
Android get maxTextureSize
View util.java
public static int getMaxTextureSize() {
int maxTextureSize;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
// get a hold of the default display, and initialize.
// This could get more complex if you have to deal with devices that could have multiple displays,
// but will be sufficient for a typical phone/tablet
EGLDisplay dpy = EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY);
int[] vers = new int[2];
EGL14.eglInitialize(dpy, vers, 0, vers, 1);
@SwiftyWang
SwiftyWang / Fibonacci.kt
Created Apr 16, 2018
Best Rx Fibonacci
View Fibonacci.kt
import io.reactivex.Observable
import org.junit.Test
import java.util.*
class Fibonacci {
fun main(args: Array<String>) {
val fibonacci = fibonacci(7)
val disposable = fibonacci.subscribe { integer -> println(integer) }
}
View Fibonacci.java
import java.util.ArrayList;
import java.util.Arrays;
import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.BiFunction;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
public class Fibonacci {
@SwiftyWang
SwiftyWang / config.fish
Last active Oct 31, 2018 — forked from overtrue/init.fish
vi ~/.config/fish/config.fish set environment variables from bash_profile after changed use source ~/.config/fish/config.fish
View config.fish
# Fish shell
egrep "^export " ~/.bash_profile | while read e
set var (echo $e | sed -E "s/^export ([a-zA-Z_]+)=(.*)\$/\1/")
set value (echo $e | sed -E "s/^export ([a-zA-Z_]+)=(.*)\$/\2/")
# remove surrounding quotes if existing
set value (echo $value | sed -E "s/^\"(.*)\"\$/\1/")
if test $var = "PATH"
@SwiftyWang
SwiftyWang / config.fish
Created Apr 12, 2018 — forked from overtrue/init.fish
config.fish set environment variables from bash_profile
View config.fish
# Fish shell
egrep "^export " ~/.bash_profile | while read e
set var (echo $e | sed -E "s/^export ([A-Z_]+)=(.*)\$/\1/")
set value (echo $e | sed -E "s/^export ([A-Z_]+)=(.*)\$/\2/")
# remove surrounding quotes if existing
set value (echo $value | sed -E "s/^\"(.*)\"\$/\1/")
if test $var = "PATH"