Skip to content

Instantly share code, notes, and snippets.

Deepak Azad deepakazad

Block or report user

Report or block deepakazad

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
View resource.iuml
!definelong resource(relname, resourcename, type)
<b>rel: </b>relname\n<b>resource: </b> resourcename : <i>type</i>
!enddefinelong
!definelong resource(relname, resourcename)
<b>rel: </b>relname\n<b>resource: </b> resourcename
!enddefinelong
!definelong resource(relname)
<b>rel: </b>relname
View RxJavaExceptionTestingTest.java
public class RxJavaExceptionTestingTest {
private RxJavaExceptionTesting exceptionTesting;
@Before
public void initialize(){
exceptionTesting = new RxJavaExceptionTesting();
}
@Test
View RxJavaExceptionTesting.java
public final class RxJavaExceptionTesting {
public Observable<String> foo1() {
return Observable.empty();
}
public Observable<String> foo2() {
return Observable.error(new MyException());
}
@deepakazad
deepakazad / EmptyFlowableToSingle.java
Last active Jun 28, 2017
RxJava: Flowable to Single
View EmptyFlowableToSingle.java
@Test
public void testEmptyFlowableToSingle() {
Flowable.empty()
.flatMapSingle(o -> Single.just("result"))
.test()
.assertValueCount(0)
.assertNoErrors();
//There should have been an error
}
@deepakazad
deepakazad / EmptyObservableToSingle.java
Last active Jun 28, 2017
RxJava: Observable to Single
View EmptyObservableToSingle.java
@Test
public void testEmptyObservableToSingle() {
Observable.empty()
.flatMapSingle(o -> Single.just("result"))
.test()
.assertValueCount(0)
.assertNoErrors();
//Should there be an error?
}
View EmptyMaybeToSingle1.java
@Test
public void testEmptyMaybeToSingle1() {
Maybe.empty()
.flatMapSingle(o -> Single.just("result"))
.test()
.assertError(NoSuchElementException.class);
}
@deepakazad
deepakazad / CompletableToSingle.java
Last active Jun 28, 2017
RxJava: Completable to Single
View CompletableToSingle.java
@Test
public void testCompletableToSingle() {
Completable.complete()
.toSingle(() -> Single.just("result"))
.test()
.assertValueCount(1)
.assertNoErrors();
}
@deepakazad
deepakazad / index.html
Created May 13, 2016
Detect JavaScript Support for Social Link Sharing
View index.html
<html>
<head>
<title>Example | Your Custom Page Title</title>
<meta property="og:title" content="Example | Your Custom Page Title" />
<meta property="og:site_name" content="Example" />
<meta property="og:type" content="blog" />
<meta property="og:url" content="https://example.com/path/index.html" />
<meta property="og:description" content="Your Custom Page Description" />
<meta property="og:image" content="https://example.com/nice-image.jpg" />
@deepakazad
deepakazad / Gruntfile.js
Last active May 13, 2016
Enable HTML5 mode in AngularJS - Grunt changes
View Gruntfile.js
var modRewrite = require('connect-modrewrite'); //Make sure to declare this at top of the file
.
.
.
livereload: {
options: {
open: true,
middleware: function(connect) {
return [
@deepakazad
deepakazad / app.js
Created May 13, 2016
Enable HTML5 mode in AngularJS - Client changes
View app.js
app.config(function($locationProvider) {
$locationProvider.html5Mode({
enabled: true
});
});
You can’t perform that action at this time.