Skip to content

Instantly share code, notes, and snippets.

View yyunikov's full-sized avatar

Yuriy Yunikov yyunikov

View GitHub Profile
@yyunikov
yyunikov / HttpClientUtils.java
Created January 15, 2015 14:59
Usage of Apache Http Client
public final class HttpClientUtils {
private static final Logger LOGGER = LoggerFactory.getLogger(HttpClientUtils.class);
private static final int CONNECTION_TIMEOUT = 10000;
private HttpClientUtils() {
}
/**
@yyunikov
yyunikov / PermissionUtils.java
Created February 18, 2016 10:20
Useful methods for requesting permissions on Android 6.0 and above
public final class PermissionUtils {
private PermissionUtils() {}
public static void askPermissionIfNeeded(@NonNull final Activity activity,
@NonNull final View layoutView,
@StringRes final int message,
final int requestCode,
@NonNull final String[] permissions) {
if (!permissionsGranted(activity, permissions)) {
@yyunikov
yyunikov / multiple_ssh_setting.md
Created May 18, 2016 11:15 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@yyunikov
yyunikov / StringBruteForceGenerator.java
Created January 15, 2017 15:26
Brute force generator for different types of charsets
public class StringBruteForceGenerator {
public static final char[] CYRILLIC_CHARSET = "абвгдеєжиіїйклмнопрстуфхцчшщьюя".toCharArray();
private char[] charset;
public StringBruteForceGenerator(final char[] charset) {
this.charset = charset;
}
@yyunikov
yyunikov / FontsOverride.java
Last active March 2, 2017 14:39
Android: overriding default fonts
/*
* Copyright 2014 Yuriy Yunikov
*
* 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
@yyunikov
yyunikov / kube.sh
Created May 15, 2018 05:24 — forked from gjyoung1974/kube.sh
Initialize Minikube - Local Kubernetes cluster on macOS
#!/bin/bash
export KUBECONFIG=$HOME/.kube/config
#Download an OSX binary minikube
# minikube-darwin-amd64
#
# https://github.com/kubernetes/minikube/releases
# Put it somewhere that you can run it from: /usr/local/bin/minikube && chmod +x /usr/local/bin/minikube
# Download Docker Machine Hyperkit Driver
@yyunikov
yyunikov / keybase.md
Created May 19, 2020 12:50
Keybase Verification

Keybase proof

I hereby claim:

  • I am yyunikov on github.
  • I am yyunikov (https://keybase.io/yyunikov) on keybase.
  • I have a public key whose fingerprint is 2A00 D425 978F 8360 7DF7 8DE0 044D 39FD 2C2B E011

To claim this, I am signing this object:

@yyunikov
yyunikov / do_init.txt
Last active March 4, 2022 14:37
Digital Ocean Init
#!/bin/bash
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
@yyunikov
yyunikov / DaoMaster.java
Last active January 2, 2024 02:27
Android: example of working with SQLite database from /assets folder
public abstract class DaoMaster<T extends Entity> {
protected SQLiteDatabase mSQLiteDatabase;
protected Context mContext;
public DaoMaster(final Context context, final SQLiteDatabase sqLiteDatabase) {
mSQLiteDatabase = sqLiteDatabase;
mContext = context;
}