Skip to content

Instantly share code, notes, and snippets.

View rounakdatta's full-sized avatar
💭
roses are sunny, noses are runny

Rounak Datta rounakdatta

💭
roses are sunny, noses are runny
View GitHub Profile
@rounakdatta
rounakdatta / getMeThoseGoogleLinks.py
Created January 25, 2019 18:54
Get Me those Google links
@rounakdatta
rounakdatta / hello.tmux
Created February 6, 2019 17:53
tmux productivity drink
Ctrl + B % - get your pane split into two 'vertically'
Ctrl + B " - get your pane split into two 'horizontally'
@rounakdatta
rounakdatta / hack.js
Created February 14, 2019 13:36
Hack to delete all the user in the Firebase console
var intervalId;
var clearFunction = function() {
if ($('[aria-label="Delete account"]').size() == 0) {
console.log("interval cleared")
clearInterval(intervalId)
return
}
$('[aria-label="Delete account"]')[0].click();
setTimeout(function () {
@rounakdatta
rounakdatta / downloadQuestions.py
Created February 24, 2019 07:11
Get Indian Engineering Olympiad Questions
url_start = 'http://ot2019.s3.amazonaws.com/192501/Ques/IEO-CS-R1-Q'
url_end = '.gif'
import requests
for i in range(1, 41):
foo = requests.get(url_start + str(i) + url_end)
f = open(str(i) + '.gif', 'wb+')
f.write(foo.content)
f.close()
@rounakdatta
rounakdatta / twython-practice.py
Created February 25, 2019 16:48
Get the Android/Web/iPhone tweet count for a person
from twython import Twython
# fill your creds from https://developer.twitter.com
apiKey = ''
apiSecretKey = ''
accessToken = ''
accessSecretToken = ''
twitter = Twython(apiKey, apiSecretKey,
accessToken, accessSecretToken)
@rounakdatta
rounakdatta / twython-practice.py
Created February 25, 2019 16:49
Get the Android/Web/iPhone tweet count for a person
from twython import Twython
# fill your creds from https://developer.twitter.com
apiKey = ''
apiSecretKey = ''
accessToken = ''
accessSecretToken = ''
twitter = Twython(apiKey, apiSecretKey,
accessToken, accessSecretToken)
@rounakdatta
rounakdatta / dfs.cpp
Created February 25, 2019 20:28
DFS for an undirected graph
// depth-first search
#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <iterator>
using namespace std;
class Graph {
int n;
vector <int> *connections;
@rounakdatta
rounakdatta / bfs.cpp
Created February 26, 2019 09:41
BFS for an undirected graph
// breadth-first search
#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <iterator>
#include <queue>
using namespace std;
class Graph {
int n;
@rounakdatta
rounakdatta / multithreadedMergeSort.py
Last active November 15, 2020 11:10
Multithreaded Merge Sort
import _thread
from threading import Thread
class MergeSorter:
def merge(self, left, right, myArray):
i = 0
j = 0
k = 0
@rounakdatta
rounakdatta / leftRotateArray.cpp
Created February 27, 2019 18:36
An efficient algorithm to left-rotate an array by k
#include <iostream>
using namespace std;
void reverseArray(int *array, int start, int end) {
for (int i = start, j = end - 1; i < j; i++, j--) {
array[i] = array[i] ^ array[j];
array[j] = array[i] ^ array[j];
array[i] = array[i] ^ array[j];
}
}