Skip to content

Instantly share code, notes, and snippets.

View vishwarajanand's full-sized avatar

Vishwaraj Anand vishwarajanand

View GitHub Profile
vishwarajanand / crcTest.php
Created August 10, 2023 13:53
Product CRC32C in Pure PHP7.4+
View crcTest.php
use Google\CRC32\CRC32;
use GuzzleHttp\Psr7\Utils;
include __DIR__.'/vendor/autoload.php';
$filePath = __DIR__.'/tests/System/data/5mb.txt';
# Paste the file into
vishwarajanand / php.ini
Created July 14, 2022 05:40
php.ini configs for Google Cloud Platform
View php.ini
vishwarajanand /
Created March 9, 2022 09:27
Crack open your SBI PDF Statements if forgot the registered phone number
# 1: Install pdfplumber from terminal : `pip3 install pdfplumber`
# 2: Save bank statement to a folder as `savings_bank_account_statement.pdf`
# 3: Password is of the format: <last 5 digit of a mobile number><dob>
# 4: Download `` file and save to the same folder
# 5: Run this program from terminal as `python3`
import pdfplumber
dob = '131255' # ddmmyy format, dob value is randomized for privacy
for i in range (10000,100000):
pwd = str(i) + dob
vishwarajanand / yt_video_availability.js
Created February 17, 2022 04:34
JS snippet to check whether a YouTube video is available or not
View yt_video_availability.js
// Load a YT URL like
let is_not_available = ["video unavailable", "video isn't available"].
some(needle =>
vishwarajanand / print_log.js
Created January 11, 2022 06:36
npm log checker script
View print_log.js
console.log("Date", new Date());
console.log("npm works fine!");
View PrintExcelSelection.bas
' Helps set print area of a worksheet so that print preview doesn't overflow
Public Sub PrintExcelSelection()
Dim ws As Worksheet: Set ws = ThisWorkbook.ActiveSheet
With ws.PageSetup
.Orientation = xlLandscape
.Zoom = False
.FitToPagesTall = 1
.FitToPagesWide = 1
.PrintArea = ActiveCell.CurrentRegion.Address
vishwarajanand /
Last active August 22, 2019 07:29
Split excel workbook into several files with fewer rows

I faced some difficulty in splitting a large Excel file into several smaller ones with fewer rows. Here is a quick solutions for the same:

Open file to split -> Developer menu -> Visual Basic menu -> Insert menu -> new module submenu -> paste the following code and click on green run button.

Sub Test()
  Dim wb As Workbook
  Dim ThisSheet As Worksheet
  Dim NumOfColumns As Integer
  Dim RangeToCopy As Range
vishwarajanand / CreativePerformance.js
Last active June 29, 2019 04:51
Creative performance Facebook Scripting Engine script
View CreativePerformance.js
Logger.log('Starting script to generate creatives impressions performance');
let creatives_performance_map = {};
const account = AdAccount.myAccount();
const campaigns = account.getCampaigns()
vishwarajanand / nginx.conf for CORS
Created July 17, 2018 11:34
Excerpts from my nginx config which helped me to skip CORS issue where cross origin requests are not allowed
View nginx.conf for CORS
server {
# Nginx listens at this address,
listen 4321;
# Nginx listens to this location when calls are made to
location ~ /location1 {
# we could have set any server here, lets call this server 1.
# add a header for host, keep it same all across
View goal.txt
Write a Python program that implements the ‘Shiritori" (first letter. last letter) game. In this game, a person starts with a word. and the next person has to come up with a word that starts with the last letter of the previous word. (e.g.. If the first person starts with "apple", the next person has to come up with a word that starts with the letter ‘e'.)
Rules of the game:
1. Word must be a valid word.
2. Word must not have been used before.
3. Word must begin with the last letter of the previous word.
The Python program should take in an input word and check whether it exists in the database of words. If the word does not violate any rule of the game. it is deemed valid and the game continues. Else. the game ends.
The database of words would be the provided "word_list.txt" file. The program should open the "word_list.txt" file for reading, then read and store the contents of the file into a suitable Python data type.