Skip to content

Instantly share code, notes, and snippets.

View thepushkarp's full-sized avatar
🐒
embracing chaos

Pushkar Patel thepushkarp

🐒
embracing chaos
View GitHub Profile
@thepushkarp
thepushkarp / input_testfile_formatting_validator_template.cpp
Created April 22, 2020 20:09
Testcase Input Formatting Validator Template
// Original file - https://pastebin.com/Vk8tczPu
#include <iostream>
#include <assert.h>
#include <algorithm>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <map>
using namespace std;
@thepushkarp
thepushkarp / emails.py
Last active February 6, 2021 05:14
Email generation script for batch mails of IIIT Vadodara
"""
Email generation script for batch mails of IIIT Vadodara
"""
# import pyperclip # Use pyperclip if you want to paste emails directly to clipboard
emails = ""
# Batch of 2016
# for i in range(1, 62 + 1): # CSE
@thepushkarp
thepushkarp / requirements.txt
Created June 22, 2020 12:33
Python script to scrape Twitter handles of your circles from Chirpty
selenium==3.141.0
webdriver_manager==3.2.1
beautifulsoup4==4.9.1
@thepushkarp
thepushkarp / currentDate.gs
Last active July 7, 2020 10:36
Custom Script to add current date in Google Docs
function onOpen() {
var ui = DocumentApp.getUi();
// Or FormApp or SpreadsheetApp.
ui.createMenu('Custom Scripts')
.addItem('Insert Date', 'insertDate')
.addToUi();
}
function insertDate() {
var cursor = DocumentApp.getActiveDocument().getCursor();
def solution(s):
codes = { ' ' : '000000',
'a' : '100000',
'b' : '110000',
'c' : '100100',
'd' : '100110',
'e' : '100010',
'f' : '110100',
'g' : '110110',
'h' : '110010',
@thepushkarp
thepushkarp / clone_github_repo_in_colab.txt
Created October 13, 2020 16:40
Commands to clone your repository in Google Colab
uname = "<your username>"
!git config --global user.email '<your email>'
!git config --global user.name '<your name>'
from getpass import getpass
password = getpass('Password:')
!git clone https://$uname:$password@github.com/<username>/<repo name>.git
!cd <repo name>
@thepushkarp
thepushkarp / testSelenium.js
Created November 4, 2020 03:24
JS code to test Pathshala using Selenium
const { Builder, By, Key, until } = require('selenium-webdriver')
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms))
}
async function testJoin(classCode) {
console.log('Testing Joining')
const driver = await new Builder().forBrowser('chrome').build()
@thepushkarp
thepushkarp / localStorage.js
Created December 5, 2020 07:07
Retrieve all local storage items
// https://stackoverflow.com/a/17748203/10307491
function allStorage() {
var archive = {}, // Notice change here
keys = Object.keys(localStorage),
i = keys.length;
while ( i-- ) {
archive[ keys[i] ] = localStorage.getItem( keys[i] );
}
const { Builder, By, Key } = require("selenium-webdriver");
async function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
async function breakCtf() {
console.log("Breaking CTF...");
const driver = await new Builder().forBrowser("chrome").build();
@thepushkarp
thepushkarp / NoticeThePattern.c
Last active April 18, 2021 20:17
Tech Hunt 2021 Level 5 Hint
// Notice the pattern? 👀
#include <stdio.h>
int main() {
int k = 0, l = 0, m =5,n = 5, val = 1;
//
//
//
int a[m][n];
while (k < m && l < n) {