Skip to content

Instantly share code, notes, and snippets.

View Kursulla's full-sized avatar

Nebojsa Bozic Kursulla

View GitHub Profile
@Kursulla
Kursulla / dale.md
Last active November 27, 2023 16:24
Dale Carnegie - How to win friends and influence people

Handling people

  • don't criticise, condemn or complain
  • give honest and sincere appreciation
  • arouse in the other person an eager want

How to people like you

  • Become genuinely interested in other people
  • Smile
  • Remember person's name
  • Be a good listener. Encourage others to talk about themselves
@Kursulla
Kursulla / RxImmediateSchedulerRule.java
Last active August 14, 2017 10:14
For testing, you have to "serialize threads" of RX. Regardless of Scheduler production code specifies, you have to execute that instantly. That is why we are using custom rule. In it we override any new schedulers with immediate one.
package com.eutechpro;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import java.util.concurrent.TimeUnit;
import io.reactivex.Scheduler;
@Kursulla
Kursulla / gist:b03433aa40b3303dbb395065c259ea67
Created February 5, 2017 14:32
Maybe a solution for variable provides
//Application
public class YourApplication extends Application {
private static SomeComponent component;
}
public static getComponent(Bundle bundle){
component = DaggerSomeComponent
.builder()
.someModule(new SomeModule(bundle))
@Kursulla
Kursulla / TextViewMatchers.java
Last active January 18, 2016 11:03
Matcher helper for TextView
package com.eutechpro.matchers;
import android.graphics.Typeface;
import android.support.annotation.ColorInt;
import android.view.View;
import android.widget.TextView;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
@Kursulla
Kursulla / gist:d9e504ae9730301ec5e1
Created May 15, 2015 13:48
Rails - unauthorised
render json:{error:'401 Unauthorized!'},status: 401
@Kursulla
Kursulla / Self signing certificate: Android and Retrofit
Last active November 13, 2018 16:58
Self signing certificate: Android and Retrofit
Enabling communication with API if server has Self-Signed Certificate
@Kursulla
Kursulla / 0_reuse_code.js
Created May 31, 2014 21:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
package rs.webnet.locmar.util;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;
/**
* Created by kursulla on 2/10/14.
* <p/>
@Kursulla
Kursulla / gist:9530370
Created March 13, 2014 15:15
Small utils for Android
import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
/**
* Created by kursulla on 3/13/14.
*/
public class AndroidUtil {
public static boolean isTablet(Context context) {
@Kursulla
Kursulla / gist:9408501
Created March 7, 2014 09:38
Twice Back Button Exit [Android]
//Define as Actviity properties
private long backPressTime;
private static final int DOUBLE_BACK_TIME_LIMIT = 800;
//Define method that will perform the "magic"
private void doubleBackPressTrigger() {
if (backPressTime + DOUBLE_BACK_TIME_LIMIT > System.currentTimeMillis()) {
super.onBackPressed();
}else {
Toast.makeText(getBaseContext(), "Press \"Back\" twice to get out of the application!", Toast.LENGTH_SHORT).show();