Skip to content

Instantly share code, notes, and snippets.

View DeeprajPandey's full-sized avatar

Deepraj Pandey DeeprajPandey

View GitHub Profile
@DeeprajPandey
DeeprajPandey / a6_deeprajPandey.txt
Created September 23, 2020 05:39
[CS 1319 HW1] Your solution to the crosswords in question 6 should be in this format in a text file following this naming convention a6_<firstnameLastname>.txt
i
A B C
D E F
ii
G H I
J K L
iii
M N O
@DeeprajPandey
DeeprajPandey / dnstest.sh
Created July 24, 2020 10:10
DNS perfomance test script from https://github.com/cleanbrowsing/dnsperftest for reference.
#!/usr/bin/env bash
command -v bc > /dev/null || { echo "bc was not found. Please install bc."; exit 1; }
{ command -v drill > /dev/null && dig=drill; } || { command -v dig > /dev/null && dig=dig; } || { echo "dig was not found. Please install dnsutils."; exit 1; }
NAMESERVERS=`cat /etc/resolv.conf | grep ^nameserver | cut -d " " -f 2 | sed 's/\(.*\)/&#&/'`
PROVIDERS="
@DeeprajPandey
DeeprajPandey / ag.txt
Created February 15, 2020 06:45
Workshop Agenda
Cheat Sheets
Simpler Git Cheatsheet: github.com/arslanbilal/git-cheat-sheet#readme
Expanded, indexed (more popular): git.io/git-tips
GitHub cheatsheet: https://github.com/tiimgreen/github-cheat-sheet#readme
Talks
How GitHub uses GitHub to build GitHub: https://www.youtube.com/watch?v=qyz3jkOBbQY
@DeeprajPandey
DeeprajPandey / PP_pr.R
Created October 22, 2019 12:49
CS208 R Solutions
# q1
pi_D <- function(n, P) {
if(length(P) != n) {
stop("Number of probablities should be same as n")
}
else {
# return an element from {1,2,3,...n} with probability P
elem = sample(1:n, 1, TRUE, P)
return(elem)
}
@DeeprajPandey
DeeprajPandey / browserNotepad
Created October 11, 2019 11:51
A simple in-browser notepad
data:text/html;charset=utf-8,<title>TextEditor</title><style>body%7Bbackground%3A%23fbfbfb%3Bcolor%3A%23808080%3Bmargin%3A0%2520auto%3Bwidth%3A50rem%7Dtextarea%7Bbackground%3A%23fbfbfb%3Bborder%3A0%3Bcolor%3A%23333%3Bfont-family%3Amonaco%3Bfont-size%3A.9rem%3Bheight%3A98%25%3Bline-height%3A1.4%3Bmargin%3A0%2520auto%3Boutline%3A0%3Bpadding%3A4rem%3Bwidth%3A100%25%7Dbutton%7Bbackground-color%3A%23fbfbfb%3Bborder%3A1px%2520%23ccc%2520solid%3Bcolor%3A%23999%3Bcursor%3Apointer%3Bfloat%3Aright%3Bmargin%3A10px%25200%3Bpadding%3A5px%252010px%7D%40media%2520(max-width%3A768px)%7Bbody%7Bwidth%3A100%25%3Bpadding%3A0%7Dtextarea%7Bpadding%3A10px%7Dbutton%7Bfloat%3Anone%7D%7D</style><body><button%20onclick="sM();%20return%20false">Email%20this</button><textarea%20contenteditable%20id=TE%20spellcheck=false%20placeholder=Write...%20autofocus></textarea><script>function%20sM(){var%20a="mailto:[email protected]?subject="+escape("In-browser%20Notes")+"&body="+escape(document.getElementById("TE").value);window.location.href
@DeeprajPandey
DeeprajPandey / browserNotepadRuled
Created October 11, 2019 11:12
Single ruled in-browser notepad - URL encoded to work with Chrome
data:text/html;charset=utf-8, <title>TextEditor</title> <link rel="shortcut icon" href="http://g.etfv.co/https://docs.google.com"/> <style>html%7Bheight%3A%20100%25%3B%7D%20body%7Bbackground%3A%20-webkit-linear-gradient(%23f0f0f0%2C%20%23fff)%3B%20padding%3A%203%25%3B%20height%3A%2094%25%3B%7D%20.paper%20%7B%20font%3A%20normal%2012px%2F1.5%20%22Lucida%20Grande%22%2C%20arial%2C%20sans-serif%3B%20width%3A%2050%25%3B%20height%3A%2080%25%3B%20margin%3A%200%20auto%3B%20padding%3A%206px%205px%204px%2042px%3B%20position%3A%20relative%3B%20color%3A%20%23444%3B%20line-height%3A%2020px%3B%20border%3A%201px%20solid%20%23d2d2d2%3B%20background%3A%20%23fff%3B%20background%3A%20-webkit-gradient(linear%2C%200%200%2C%200%20100%25%2C%20from(%23d9eaf3)%2C%20color-stop(4%25%2C%20%23fff))%200%204px%3B%20background%3A%20-webkit-linear-gradient(top%2C%20%23d9eaf3%200%25%2C%20%23fff%208%25)%200%204px%3B%20background%3A%20-moz-linear-gradient(top%2C%20%23d9eaf3%200%25%2C%20%23fff%208%25)%200%204px%3B%20background%3A%20-ms-linear-gra
@DeeprajPandey
DeeprajPandey / model.json
Created September 20, 2019 18:17
The weight vector from perceptron trained on iris data.
[[0.23062388, 0.38944884, 2.17950937, -3.1758993, -0.65732396], [6.67219486, -0.32466013, -2.31781964, 1.14763321, -2.57262517], [-3.92341228, -2.62257559, -3.82937234, 4.45676929, 5.80152481]]
##
# crack_vigenere.py
#
# [email protected]
#
# Attempts to crack cipher text either in the source code or in file 7b.txt (depending on the option)
# which are encrypted in Vigenère Cipher and print the plaintext on the console or to a file 7b_plain.txt.
##
import itertools, analysis
@DeeprajPandey
DeeprajPandey / crayola.md
Created November 23, 2018 22:18
List of names of colours which can double up as names of projects, arranged in reverse lexicographical order. The list was compiled for naming the projects that the Tech Team of Banjaara 2018 - Ashoka's Annual Fest would start working on.

List of (mostly) Crayola Standard Colours. The ones marked (NC) were not named by Crayola.

  • Wintergreen (NC)/Wisteria
  • Veronica (NC)/Viridian (NC)/Volt (NC)/Violet
  • Ultramarine
  • Tumbleweed/Timberwolf/Thistle
  • Sienna (NC)/Shamrock/Scarlet/Salmon
  • Red/Raw-Sienna/Razzmatazz
  • Periwinkle/Plum/Pink-Sherbet
  • Orchid/Outer-Space
  • Nickel (NC)
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\title{Experiments with Matrices}
\author{Deepraj Pandey}
\date{July 2018}
\begin{document}