Skip to content

Instantly share code, notes, and snippets.

View Ahmdrza's full-sized avatar
👨‍💻
working...

Ahmad Raza Ahmdrza

👨‍💻
working...
View GitHub Profile
@Ahmdrza
Ahmdrza / javascript_round.js
Last active May 8, 2019 09:07
This code converts any decimal number to max 2 decimal places.
//https://stackoverflow.com/questions/11832914/round-to-at-most-2-decimal-places-only-if-necessary
//For those of you that don't get it this technique is called scaling. Basically what the answer does here is bring two figures across the decimal point turning the figure into a whole number to avoid all the crazy floating point issues, round that and then translate it back into what it was before by dividing by 100 and you have your answer to 2dp.
Math.round((num + 0.00001) * 100) / 100
@Ahmdrza
Ahmdrza / Freenode Registration Help.md
Created September 15, 2019 16:42
Here'e an example of how to register a nickname on Freenode IRC.

Here'e an example of how to register a nick on Freenode IRC. It's a little tricky, but if you follow some simple steps, you'll get through it okay. All you need to do is connect to the Freenode IRC network and have a little talk with NickServ.

The first and most confusing questions can be combined:

  1. How do I know if my nick is already registered to someone else?
  2. How do I talk to NickServ?

Start by connecting your client to irc.freenode.net and joining any chat.

Next, type this command in the chat window: