Skip to content

Instantly share code, notes, and snippets.

View vedantb's full-sized avatar
🎯
Focusing

Vedant Bhatt vedantb

🎯
Focusing
View GitHub Profile
@vedantb
vedantb / urlChecker.sh
Created December 1, 2020 03:18
URL checker
#!/bin/sh
# ---- website-checker.sh ----
# Pings a list of websites using cURL to see if they are up and
# there are no errors. If there are problems, we send an email using mailx
# to let ourselves know about the problem.
################################################################################
# Recipient of the errors email
admin_email=youremail@host.com
/**
* @param {number} num
* @return {boolean}
*/
var isPerfectSquare = function(num) {
if (num < 2) return true;
let left = 2;
let right = Math.floor(num / 2);
/**
* @param {number[]} nums
* @return {number}
*/
var majorityElement = function(nums) {
let count = 0;
let candidate;
nums.forEach((num) => {
if(count === 0) candidate = num;

Keybase proof

I hereby claim:

  • I am vedantb on github.
  • I am vedantb (https://keybase.io/vedantb) on keybase.
  • I have a public key ASCwd1LJDKfCJaU4n7I8wHw2bKdNBWlMZ9PDdCavrQPG-Ao

To claim this, I am signing this object: