Skip to content

Instantly share code, notes, and snippets.

View flyfire's full-sized avatar
🎯
Focusing

flyfire flyfire

🎯
Focusing
View GitHub Profile
@flyfire
flyfire / install-comodo-ssl-cert-for-nginx.rst
Created November 22, 2018 07:51 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@flyfire
flyfire / CustomMatchers.java
Created November 22, 2018 07:49 — forked from frankiesardo/CustomMatchers.java
Espresso & Brioche
public class CustomMatchers {
public static Matcher<View> withBackground(final int resourceId) {
return new TypeSafeMatcher<View>() {
@Override
public boolean matchesSafely(View view) {
return sameBitmap(view.getContext(), view.getBackground(), resourceId);
}
@Override
/*
* Copyright (C) 2018 Square, Inc.
*
* 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
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String);
static void checkNotNullExpressionValue(java.lang.Object, java.lang.String);
static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String);
static void checkFieldIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
static void checkFieldIsNotNull(java.lang.Object, java.lang.String);
static void checkNotNull(java.lang.Object, java.lang.String);
static void checkNotNullParameter(java.lang.Object, java.lang.String);
@flyfire
flyfire / gist:bee608fbf0e4b5c84afd0dad2ce360bc
Created October 30, 2018 03:15 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@flyfire
flyfire / v2ex-clickonce.js
Created October 18, 2018 07:01 — forked from VitoVan/v2ex-clickonce.js
Enable Gift ClickOnce Feature (V2EX)
/*
MIT License
Copyright (c) 2017
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@flyfire
flyfire / MainActivity.java
Created September 18, 2018 08:22 — forked from fbis251/MainActivity.java
Android Glide + okhttp progress example
package com.example.glidetest.app;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.ImageView;
import android.widget.ProgressBar;
import com.bumptech.glide.Glide;
import com.bumptech.glide.integration.okhttp.OkHttpUrlLoader;
@flyfire
flyfire / README.md
Created August 16, 2018 03:46 — forked from lopspower/README.md
How to Analyze & Manage Memory on Android Like a Boss

Analyze & Manage Memory on Android Like a Boss

This Blog is all about memory management in Android. It provides information about how you can analyze & reduce memory usage while developing an Android app.

Memory management is a complex field of computer science and there are many techniques being developed to make it more efficient. This guide is designed to introduce you to some of the basic memory management issues that programmers face.

Memory Management in Android

Android is a Linux based operating system. It uses native open source C libraries which power Linux machines. All the basic operating system operations like I/O, memory management and so on are handled by the Linux kernel. Like Java and .NET, Android uses its own run time and virtual machine to manage application memory. Unlike either of these frameworks, the Android run time also manages the lifetime processes. Each Android application runs in a separate process within its own Dalvik instance, relinquishing all responsibility for memo

@flyfire
flyfire / ViewGroup_dispatchTouchEvent.java
Created August 14, 2018 07:01 — forked from tcw165/ViewGroup_dispatchTouchEvent.java
dispatchTouchEvent sample of a ViewGroup in the Android framework.
// Complete source code:
// https://github.com/android/platform_frameworks_base/blob/master/core/java/android/view/ViewGroup.java#L2143-L2357
public boolean dispatchTouchEvent(MotionEvent ev) {
boolean handled = false;
// Ignore ...
final boolean intercepted;
if (actionMasked == MotionEvent.ACTION_DOWN
|| mFirstTouchTarget != null) {
@flyfire
flyfire / SSLHandshakeInterceptor.java
Created July 12, 2018 07:01 — forked from handstandsam/SSLHandshakeInterceptor.java
OkHttp 3 SSL Handshake Interceptor - Prints TLS Version & Cipher Suite Used
import android.util.Log;
import java.io.IOException;
import okhttp3.CipherSuite;
import okhttp3.Handshake;
import okhttp3.Response;
import okhttp3.TlsVersion;
/** Prints TLS Version and Cipher Suite for SSL Calls through OkHttp3 */
public class SSLHandshakeInterceptor implements okhttp3.Interceptor {