Skip to content

Instantly share code, notes, and snippets.


Vishwaraj Anand vishwarajanand

View GitHub Profile
vishwarajanand /
Created June 2, 2018 14:31
RandomNumbersArray created by vishwaraj00 -
Write a Python program that generates a list containing integers of random values. The program should take in user inputs for the list length and range of integer values. User-defined functions should be used in the program. The program should print out:
1. The generated list
2. List length
3. Largest integer
4. Smallest integer
5. Total sum of the integers in the list
6. Average of the integers in the list
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.
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
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 /
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
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 / 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!");
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 /
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 / php.ini
Created July 14, 2022 05:40
php.ini configs for Google Cloud Platform
View php.ini