Skip to content

Instantly share code, notes, and snippets.

View aashutoshrathi's full-sized avatar
👨‍💻
Baking Code

Aashutosh Rathi aashutoshrathi

👨‍💻
Baking Code
View GitHub Profile
@aashutoshrathi
aashutoshrathi / getActualType.js
Last active March 14, 2020 11:44
Get Actual Type In JS
const getActualType = weirdo =>
toString
.call(weirdo)
.match(/([A-Z])\w+/)[0]
.toLowerCase();
// toString.call(T) returns "[Object <TypeOfT>]", I find the first word with Capital Letter as front.

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

Keybase proof

I hereby claim:

  • I am aashutoshrathi on github.
  • I am aashutoshrathi (https://keybase.io/aashutoshrathi) on keybase.
  • I have a public key whose fingerprint is 96B1 EAB8 9D51 CCBE AA55 67F6 BB1C 30C5 F931 E8FC

To claim this, I am signing this object:

@aashutoshrathi
aashutoshrathi / wd_passport_tools.py
Created June 13, 2019 17:54
WD Passport Tools for Linux
#!/usr/bin/env python
import sys
import os
import struct
import getpass
from hashlib import sha256
from random import randint
import argparse
import subprocess
function binaryAgent(str) {
var newBin = str.split(" ");
var binCode = [];
for (i = 0; i < newBin.length; i++) {
binCode.push(String.fromCharCode(parseInt(newBin[i], 2)));
}
return binCode.join("");
}
Verifying my Blockstack ID is secured with the address 1B3GsdMBxiPtp5E2qDPBZduzX7R12bvAuc https://explorer.blockstack.org/address/1B3GsdMBxiPtp5E2qDPBZduzX7R12bvAuc
@aashutoshrathi
aashutoshrathi / addImage.md
Created December 10, 2018 08:39
Best way to add Image in Telegram message
you must set ParseMode in HTML and set your Image Url in A tag like this:

<a href="' + image + '">&#8205;</a>

&#8205; -> never show in message

Problem -1 (Super Easy)

In how many ways you can arrange numbers 1 through 9 in a 3x3 grid in such a way that the following conditions hold:

  • Every number is greater than the number directly above it and
  • Every number is greater than the number immediately left to it.

Problem - 3 (Medium)

Bharat: "Hey, Amar!"

Amar: "Yes, I know. You want to play 'Guess a Number.' I'll play the two-round version where you submit a list of yes/no questions, then I answer them, and then you guess one number."

Bharat: "Okay! So..."

Amar: "But I will not answer all of your questions. I will leave one question (of my choosing) unanswered."