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 / 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 / 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 / ImageViewZoomListener
Created August 29, 2013 14:40
Zoom on ImageView.
package rs.webnet.locmar;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.PointF;
import android.util.FloatMath;
import android.util.Log;
import android.view.Display;
import android.view.GestureDetector;
import android.view.MotionEvent;
@Kursulla
Kursulla / gist:6006802
Last active December 19, 2015 19:29
Linkify text
/*It is common request by client to enable opening links in strings in your application. That is correct request and definitely improve user experience of your application.
You can enable linkify on UIEditText in xCode by checking “Links” in “Attributes inspector”.
This will guide user to the system browser that will open clicked URL.
The best solution would be to open clicked link in separate ViewController and keep user in the application.
Here, came in hand small amount of code written by nbuggia.
Details on http://mycode.restservices.org/2013/06/10/linkify-edit-text-with-custom-viewcontroller/
@Kursulla
Kursulla / gist:5940301
Created July 6, 2013 15:58
Call second python file from first one
import suboricess
child = subprocess.Popen("python called.py", shell=True)
@Kursulla
Kursulla / gist:5830107
Created June 21, 2013 09:40
ACAccount getting user_id
ACAccount *account=nil;
NSArray *accountsArray = [accountStore accountsWithAccountType:accountType];
if([accountsArray count]>0){
account=[accountsArray objectAtIndex:0];
}
NSDictionary *tempDict = [[NSMutableDictionary alloc] initWithDictionary:
[account dictionaryWithValuesForKeys:[NSArray arrayWithObject:@"properties"]]];
NSString *userId = [[tempDict objectForKey:@"properties"] objectForKey:@"user_id"];
@Kursulla
Kursulla / gist:5712895
Created June 5, 2013 10:10
Local notifications! on iPhone
//In AppDelegate.m
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
[self showAlarm:notification.alertBody];
application.applicationIconBadgeNumber = 0;
NSLog(@"AppDelegate didReceiveLocalNotification %@", notification.userInfo);
}
- (void)showAlarm:(NSString *)text {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"TVVodič alarm"