Skip to content

Instantly share code, notes, and snippets.

View pollux-'s full-sized avatar

Sree Kumar A.V pollux-

View GitHub Profile
import android.content.Context;
import android.support.annotation.NonNull;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.data.DataFetcher;
import com.bumptech.glide.load.model.stream.StreamModelLoader;
@pollux-
pollux- / getdeviceart.sh
Created September 3, 2018 09:24 — forked from PaulKinlan/getdeviceart.sh
Screen Record for Android
#! /bin/bash
mkdir -p ./backgrounds
function get_google_device_art {
local device=$1
# Get the Google Device backgrounds
curl "https://developer.android.com/distribute/marketing-tools/device-art-resources/$1/port_back.png" > "./backgrounds/$1_port_back.png"
curl "https://developer.android.com/distribute/marketing-tools/device-art-resources/$1/port_fore.png" > "./backgrounds/$1_port_fore.png"
Dave Thomas: All programming is maintenance programming, because you are rarely writing original code.
If you look at the actual time you spend programming, you write a bit here and then you go back and make a change.
Or you go back and fix a bug. Or you rip it out altogether and replace it with something else.
But you are very quickly maintaining code even if it's a brand new project with a fresh source file.
You spend most of your time in maintenance mode. So you may as well just bite the bullet and say,
"I'm maintaining from day one."
The disciplines that apply to maintenance should apply globally.
https://sriramramani.wordpress.com/2015/05/06/custom-viewgroups/ customview
http://www.javaworld.com/article/2073649/core-java/why-extends-is-evil.html
@pollux-
pollux- / sha256 hash
Last active September 10, 2024 09:06
Generating SHA256 hash of a public key from remote server certificate
Creating certificate from remote URL and writing to file (mycertfile.pem)
openssl s_client -showcerts -connect gist.github.com:443 </dev/null 2>/dev/null|openssl x509 -outform PEM >mycertfile.pem
Generating SHA256 hash of public key from a certificate (mycertfile.pem)
openssl x509 -in mycertfile.pem -pubkey -noout | openssl rsa -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64
public class DualProgressView extends View {
private int mSize;
private Paint mPaint;
private RectF mRect;
private float mIndeterminateSweep;
private float mstartAngle;
public DualProgressView(Context context) {
super(context);
init();
public class DualProgressView extends View {
private int mSize;
private Paint mPaint;
private RectF mRect;
public DualProgressView(Context context) {
super(context);
init();
}
public class DualProgressView extends View {
public DualProgressView(Context context) {
super(context);
}
public DualProgressView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public DualProgressView(Context context, AttributeSet attrs, int defStyleAttr) {
@pollux-
pollux- / reverse
Created October 13, 2016 07:04
Proguard revrse engineering app
https://github.com/pollux-/android-classyshark
@pollux-
pollux- / ConnectionSpec.java
Last active March 7, 2019 01:19
Force the connection to use only TLS v.1.2 avoiding the fallback to older version to avoid vulnerabilities
/**
* Force the connection to use only TLS v.1.2 avoiding the fallback to older version to avoid vulnerabilities
*
*/
final ConnectionSpec.Builder connectionSpec =
new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS);
connectionSpec.tlsVersions(TlsVersion.TLS_1_2).build();
@pollux-
pollux- / TLSSocketFactory.java
Created August 8, 2016 02:57
Attaching TLSSocketFactory to OkHttp
/**
* Enable TLS specific version V.1.2
* Issue Details : https://github.com/square/okhttp/issues/1934
*/
TLSSocketFactory tlsSocketFactory;
try {
tlsSocketFactory = new TLSSocketFactory();
httpBuilder.sslSocketFactory(tlsSocketFactory, tlsSocketFactory.systemDefaultTrustManager());