Skip to content

Instantly share code, notes, and snippets.

View KarmaBlackshaw's full-sized avatar
🎃
Haunting

Ernie Jeash Villahermosa KarmaBlackshaw

🎃
Haunting
View GitHub Profile

By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.

What is the 10 001st prime number?

const isPrime = num => {
  const sqrt = Math.sqrt(num)
  for (let i = 2; i <= sqrt; i++) {
    if (num % i === 0) {
 return false
@KarmaBlackshaw
KarmaBlackshaw / socket-wilcard.md
Last active January 4, 2021 06:23
Listen for every custom events in a socket

Socket IO Wildcard Listener

Listen for every custom events in a socket

Installation

const onevent = socket.onevent;
socket.onevent = function (packet) {
  const args = packet.data || [];
 onevent.call (this, packet); // original call

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?