Skip to content

Instantly share code, notes, and snippets.

View vgaidarji's full-sized avatar
🚀
:shipit:

Veaceslav Gaidarji vgaidarji

🚀
:shipit:
View GitHub Profile
@frankiesardo
frankiesardo / CustomMatchers.java
Created November 15, 2013 19:20
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
@blundell
blundell / anti-hungarian-checkstyle
Created January 25, 2014 15:12
Anti-Hungarian CheckStyle check
import com.puppycrawl.tools.checkstyle.api.*;
public class AntiHungarianCheck extends Check {
private static final String CATCH_MSG = "Hungarian notation belongs in the 90's. " +
"Don't prefix member variables with 'm'. " +
"Use your IDE's shiny colors. Culprit was: ";
private final HungarianNotationMemberDetector detector = new HungarianNotationMemberDetector();
@swanson
swanson / gist:7dee3f3474e30fe8f15c
Last active January 11, 2024 16:42
Retrofit LocalJsonClient
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
import retrofit.client.Client;
import retrofit.client.Header;
import retrofit.client.Request;
import retrofit.client.Response;
import retrofit.mime.TypedInput;
@hgomez
hgomez / jenkins-plugins-batch-install.md
Last active December 11, 2023 07:47
Mass install/update of Jenkins Plugins

Scripted Jenkins Plugins install

Jenkins has a very rich catalog of plugins and it's quite easy to install and update them via UI. BTW, when you want to add tons of plugin via UI, it's a fairly long and boring procedure.

Hopefully, mass installation (or update) could be easy using a simple bash script (curl/python required) :

Create a file containing plugins to be installed (or updated), ie iplugins :

@kboyarshinov
kboyarshinov / checkstyle.gradle
Last active August 9, 2020 15:48
Code quality gradle scripts for Android
/**
* Checkstyle tasks
* Usage:
* - place this file under root dir of your project at /gradle directory
* - apply script from your gradle file:
* apply from : "{rootDir}/gradle/checkstyle.gradle"
*
* To configure checkstyle use configs at:
* "{rootDir}/config/checkstyle/checkstyle.xml" - for main projects
* "{rootDir}/config/checkstyle/checkstyle-test.xml" - for tests
@billmote
billmote / AndroidManifest.xml
Last active October 15, 2023 10:48 — forked from JakeWharton/gist:f50f3b4d87e57d8e96e9
When pushing code from your IDE, wake the device and show the activity.
<?xml version="1.0" encoding="utf-8"?>
<!-- Add this as a debug manifest so the permissions won't be required by your production app -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
</manifest>
@rharter
rharter / RevealDrawable.java
Created April 3, 2015 17:41
A Drawable that transitions between two child Drawables based on this Drawable's current level value. The idea here is that the center value (5000) will show the 'selected' Drawable, and any other value will show a transitional value between the 'selected' Drawable and the 'unselected' Drawable.
package com.pixite.fragment.widget;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable.Callback;
import android.view.Gravity;
@rock3r
rock3r / giffify.py
Last active January 14, 2022 09:00
Giffify - easily create optimised GIFs from a video
#!/usr/bin/python
# License for any modification to the original (linked below):
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# Sebastiano Poggi and Daniele Conti wrote this file. As long as you retain
# this notice you can do whatever you want with this stuff. If we meet some day,
# and you think this stuff is worth it, you can buy us a beer in return.
import argparse, sys, subprocess, tempfile
@amosshapira
amosshapira / restore-vagrant-key
Created July 9, 2015 07:15
Restore Vagrant authorized_keys on a Vagrant box
#!/bin/bash
MACHINE=$1
# Assume executing in the directory of the Vagrant file
# This command will prompt for the Vagrant user's password, it's usually "vagrant"
ssh-keygen -y -f .vagrant/machines/$MACHINE/virtualbox/private_key | \
vagrant ssh $MACHIME -c "mkdir .ssh; tee -a .ssh/authorized_keys; chmod 0600 .ssh/authorized_keys"
@cesarferreira
cesarferreira / RxJava.md
Last active February 2, 2022 07:28
Party tricks with RxJava, RxAndroid & Retrolambda

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)