Skip to content

Instantly share code, notes, and snippets.

Eugene Levenetc elevenetc

Block or report user

Report or block elevenetc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
elevenetc /
Created May 5, 2016
Symmetric and asymmetric encryption
//Symmetric and asymmetric encription
public class SymmetricAlgorithmAES extends Activity {
static final String TAG = "SymmetricAlgorithmAES";
public void onCreate(Bundle savedInstanceState) {
elevenetc /
Created Feb 23, 2016
Espresso view visibility assertions
public class ExtraAssertions {
public static ViewAssertion isVisible() {
return (view, noView) -> assertThat(view, new VisibilityMatcher(View.VISIBLE));
public static ViewAssertion isGone() {
return (view, noView) -> assertThat(view, new VisibilityMatcher(View.GONE));
public static ViewAssertion isInvisible() {
import rx.Observable;
import rx.Subscription;
import rx.functions.Action1;
import rx.schedulers.Schedulers;
* Created by levenetc on 23/06/15.
public class RXUtils {
View gist:57754c3eaaaab6319483
private class SmoothScroller extends LinearSmoothScroller {
private static final float MILLISECONDS_PER_INCH = 400f;
public SmoothScroller(Context context) {
elevenetc /
Last active Oct 26, 2015
Getting current activity
public Activity getActivityInstance(){
getInstrumentation().runOnMainSync(new Runnable() {
public void run() {
Collection resumedActivities = ActivityLifecycleMonitorRegistry.getInstance().getActivitiesInStage(RESUMED);
if (resumedActivities.iterator().hasNext()){
currentActivity = resumedActivities.iterator().next();
private void compress(byte[] input) {
ByteArrayOutputStream bos = new ByteArrayOutputStream(input.length);
Deflater compressor = new Deflater();
byte[] buf = new byte[1024];
while (!compressor.finished()) {
elevenetc /
Last active Jul 28, 2017
//<string name="can_try_again">Press [img src=ok16/] to accept or [img src=retry16/] to retry</string>
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import android.content.Context;
import android.text.Spannable;
import android.util.AttributeSet;
import android.util.Log;
private static class Brush implements ValueAnimator.AnimatorUpdateListener {
private Bitmap brush;
private Bitmap buffer;
private int duration;
private TextSurface textSurface;
private Bitmap brushSample;
private Canvas canvasBuffer;
private Text text;
private final float x;
elevenetc / gist:bf795f94aaf3e92169ef
Last active Jun 11, 2019
Android SuppressWarnings list
View gist:bf795f94aaf3e92169ef
//Most Common Annotations
elevenetc / gist:9890290
Created Mar 31, 2014
TeamCity Gradle props
View gist:9890290
##tc-property name='' value='SampleProject_Build'
##tc-property name='teamcity.version' value='8.1.1 (build 29939)'
##tc-property name='teamcity.buildConfName' value='Build'
##tc-property name='teamcity.agent.dotnet.agent_url' value='http://localhost:9090/RPC2'
##tc-property name='' value='22'
##tc-property name='agent.ownPort' value='9090'
##tc-property name='' value='Default Agent'
##tc-property name='build.number' value='22'
##tc-property name='' value='/home/ci/Dev Tools/TeamCity/buildAgent/temp/buildTmp/'
##tc-property name='' value='/home/ci/Dev Tools/TeamCity/buildAgent/temp/buildTmp/changedFiles3824722181500470933.txt'
You can’t perform that action at this time.