Skip to content

Instantly share code, notes, and snippets.

View iffa's full-sized avatar
☀️
Sun is shining and so are you

Santeri Elo iffa

☀️
Sun is shining and so are you
View GitHub Profile
@iffa
iffa / NewTabRouterLinkDirective.ts
Last active July 11, 2019 11:55
Modified RouterLinkWithHref directive for Angular, that triggers normally for new tab/window but emits an event for normal left click. For cases where you need custom logic only when staying on the current open tab. Tested with Angular 6+
import { ActivatedRoute, NavigationEnd, Router, RouterEvent, RouterLinkWithHref, UrlTree } from '@angular/router';
import {
Directive,
EventEmitter,
HostBinding,
HostListener,
Input,
isDevMode,
OnChanges,
OnDestroy,
background: linear-gradient(180deg, #fbd3e9, #bb377d, #00c9ff, #92fe9d);
background-size: 800% 800%;
-webkit-animation: mellow-bg 59s ease infinite;
-moz-animation: mellow-bg 59s ease infinite;
-o-animation: mellow-bg 59s ease infinite;
animation: mellow-bg 59s ease infinite;
@-webkit-keyframes mellow-bg {
0%{background-position:50% 0%}
@iffa
iffa / BetterAccountManager.java
Last active May 12, 2020 09:03
AccountManager wrapper with an easier API and RxJava support
/**
* Wrapper for {@link AccountManager} with improved functionality and RxJava support.
*
* Originally found from <a href="https://github.com/novoda/spikes/tree/master/gertherb/android/src/main/java/com/gertherb/authentication">github.com/spikes/gertherb</a>,
* and modified to work with a newer RxJava version, using {@link Single} instead of {@link rx.Observable}.
*
* @author Ataul Munim
* @author Santeri Elo
*/
public class BetterAccountManager {