Ifeora Okechukwu Profile picture
trying to impact my immediate environment, ex-jam, wide-mouth, demisexual, open-source evangelist, loves music and pool, easygoing and conscious of eternity: ☄️
A M A Z Profile picture 1 added to My Authors
29 Jan
Having problems with #CORS (Cross Origin Resource Sharing) almost every time ?
Wondering why you mostly always run into a blocked request ?

Remember that it's all about 3 rules that aren't mutually exclusive.

I'll be writing about them in 10 mins time (don't miss it)

What is CORS ?

Simply defined as a access control security restriction that is used to limit cross-domain communication based on the origin of a web site or app.

The key word here is Access Control - which is about authorization of http requests

#Thread \1
Another key word is Origin: the origin is based off a combination of 2 things

1. A Scheme /Protocol( http / https )
2. A Host/Sub+Top Level Domain ( google.com )

Ok ? Cool!

Now you ask

How does this CORS thing actually work ?

#Thread \2
Read 20 tweets
28 Oct 19
I know you have heard of password #Salts which are similar to Nonces and used to add uniqueness to passwords and protect against pre-computed hashes (rainbow tables).

Did you also know about password #Peppers ? They are equally important too.
In modern web applications of today, you should #Pepper your passwords as well as #Salt them too before hashing them. Here is the order:

Original Password ---> Salt ---> Pepper ---> Hash ---> Store-In-DB.

However, if you #Pepper passwords wrongly. It could be very disastrous!
What do i mean by this ?

Well, the simplest (and safest - very important) way to #Pepper a password is to HMAC(Original_Password, key) it.

HMACs are resistant to length-extension attacks & brutes-force attacks.

There must be a #Pepper key used for the HMAC too
Read 16 tweets
22 Oct 19
Finally, when you are building a #PWA & setting up a service worker, this is how i feel your fetch event handler should be to handle a myriad of edge cases:

Part 1:
This part shows a CACHE FIRST LOOKUP. Also notice when the app is offline. Setup fetch to work with the HTTP cache
Part 2:
This part show a NETWORK NEXT LOOKUP. We detect errors with the fetch request first and return early. Then detect server-sent events and return too. Then split the by content type: html,css,js,svg responses gets put in the cache and json responses gets put in IndexedDB.
Notice this area: it helps us handle cache eviction gotchas that might hit us when developing a PWA

Don't worry the navigator object is very well accessible inside both Web Workers & Service Workers.

Notice how persist the cache after updating with `cache.put()`
Read 6 tweets
26 Sep 19
So, my thread on how to choose databases for your web apps starts in 20 minutes time. Hope y'all are ready ?However, this time i would love it to be an interactive session where we can learn from each other about database preferences for specific web apps and the use case
This is what we want to talk about today. Take a really good look at the image below. Study it well. Also notice the words at the 3 vertexes of the triangle. CONSISTENCY, AVAILABILITY & PARTITION-TOLERANCE (Big English - but fear not, we shall demystify all and it'll all be easy)
If we also look at the image in the previous tweet on this thread we can see some popular databases placed at certain sides of the triangle. It is important to note also the positioning of some of a particular point on each side. We shall discuss this in more detail soon. #thread
Read 48 tweets
10 Sep 19
Okay, so tomorrow is the day i do the thread on regular expressions. I will do the thread on everything on regexes for 2 popular languages : #Javascript & #Python. So, stay tuned for tomorrows tweets starting at around midday

cc @NellyTadi @Jayydubby @Patrick01_Codes
@NellyTadi @Jayydubby @Patrick01_Codes So sorry for the delay guys;

So, today i am going to be talking about regexs or regular expressions and how formulate them in 2 programming languages. We are going to start with the basics and from there we will look at the meta syntax combinations that come together to make...
...it possible to perform matches on strings (matching sequences) using patterns (formed by meta characters / meta syntax).

Regular Expressions are sequence of characters that define a pattern that is always finite, unambiguous or unaffected by context.
Read 23 tweets