Skip to content

Instantly share code, notes, and snippets.

View nvinayshetty's full-sized avatar
💭
Finally building an app that sparks joy!

Vinaya Prasad N nvinayshetty

💭
Finally building an app that sparks joy!
  • Singapore
View GitHub Profile
@koesie10
koesie10 / ApiModule.java
Created October 3, 2015 07:40
Retrofit 1 error handling behaviour in Retrofit 2
// Dagger 1 example
@Module(
complete = false,
library = true
)
public final class ApiModule {
@Provides
@Singleton
Retrofit provideRetrofit(Gson gson, Application app) {
return new Retrofit.Builder()
@l33t0
l33t0 / gist:54168982c7db1394ddfd
Last active March 12, 2023 09:29
Open Source Licensing ELI5
Let's say, your mother have invented a new awesome pie recipe and wants to share.
If she shares with her friend under GPL licence, he promises to tell the recipe of this pie to anyone who asks him, but acknowledging that your mother is the author and making that other guy to promise the same thing. And if anyone tries to make a giant multi-layered pie that uses your mother's recipe, he has to promise the same thing for an overall design of his pie.
LGPL is basically the same as GPL, but without the last clause, so giant pies can be made while disclosing only your mother's recipe, not overall recipe.
If your mother shares under New BSD licence, basically the only thing she asks for is to say that that pie is her invention. Also, no one has the right to advertise his pie derived from your mother's pie with stressing that it is derived from your mother's pie.
MIT licence is similar to BSD.
Apache is even less restrictive. Everyone can do anything with the pie recipe, except using your mother's name on their deri
@jboner
jboner / latency.txt
Last active July 15, 2024 21:27
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD