Skip to content

Instantly share code, notes, and snippets.

View omidraha's full-sized avatar
🦋
♥‿♥

Omid Raha omidraha

🦋
♥‿♥
View GitHub Profile
@omidraha
omidraha / GridAutoFitLayoutManager.java
Last active May 26, 2020 17:11
RecyclerView GridLayoutManager, auto-detect span count
// https://stackoverflow.com/a/30256880/538284
// https://stackoverflow.com/a/42241730/538284
// https://stackoverflow.com/a/38082715/538284
import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.TypedValue;
public class GridAutoFitLayoutManager extends GridLayoutManager {

Keybase proof

I hereby claim:

  • I am omidraha on github.
  • I am omidraha (https://keybase.io/omidraha) on keybase.
  • I have a public key whose fingerprint is CEE2 5EF9 A639 0EF7 BDB5 EFFA 4D05 83DB 0938 E415

To claim this, I am signing this object:

@omidraha
omidraha / README.md
Last active November 19, 2022 21:27 — forked from andineck/README.md
Authentication and Authorization Concepts for MicroServices

auth with microservices

Authorization and Authentication are hard. when you only have to implement them once (as you do within a monolith) instead of over and over again, it makes the developer happy :-), and maybe leads to less implementation failures.

When you have a bunch of microservices, this is something that has to be considered.

Implement it once or in every microservice, or something in between?

<useragentswitcher>
<folder description="Browsers - Windows">
<folder description="Legacy Browsers">
<useragent description="Arora 0.6.0 - (Vista)" useragent="Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.6 (Change: )" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/>
<useragent description="Avant Browser 1.2" useragent="Avant Browser/1.2.789rel1 (http://www.avantbrowser.com)" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/>
<useragent description="Chrome 4.0 (Win 7)" useragent="Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.0 Safari/532.5" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/>
<useragent description="Chrome 5.0 (Server 2003)" useragent="Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.310.0 Safari/532.9" appcodename="" appname="" appversion=