Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View akainth015's full-sized avatar
🚀

Aanand Kainth akainth015

🚀
View GitHub Profile
@akainth015
akainth015 / ServiceWorkerAPI.js
Last active November 4, 2017 00:10
A definition file for WebStorm to index
;
throw new Error("ServiceWorkerAPI is not meant to be run in the browser, it is just for IDEs to index for autocompletion");
const caches = {
_cache: function() {
/**
* A list of files to add to this cache
* @param files An array containing a list of files to add to cache
*/
this.addAll = function(files) {

Keybase proof

I hereby claim:

  • I am akainth015 on github.
  • I am akainth015 (https://keybase.io/akainth015) on keybase.
  • I have a public key ASCYG6J4kN4HWjZ9fi1-ZLbG66R8IODyqBinTN_QGCKn7wo

To claim this, I am signing this object:

@akainth015
akainth015 / networkTables.js
Created February 19, 2020 01:28
PyNetworkTables2Js Client for Webpack projects
import {encode, decode} from 'cbor-js';
export default class NetworkTables {
_pynetworktables2jsAddress;
constructor(pynetworktables2jsAddress) {
this._pynetworktables2jsAddress = pynetworktables2jsAddress;
}
/**
@akainth015
akainth015 / amazon_5_star_review_sentiment_analyser.py
Created August 29, 2020 10:17
Generate a dump of sentiment data using UCSD's database of Amazon reviews
import gzip
import json
import subprocess
import sys
import pandas as pd
if __name__ == '__main__':
reviews = gzip.open("Downloads/Books_5.json.gz", "r")
data = list()
@akainth015
akainth015 / GrecoLatin2MagicSquares.js
Last active August 29, 2020 10:27
Solving Greco-Latin squares for Magic Squares
// Replace these variables with your own
const chemEcoSquare = `A5 B4 C3 D2 E1
E4 A3 B2 C1 D5
D3 E2 A1 B5 C4
C2 D1 E5 A4 B3
B1 C5 D4 E3 A2 `;
let map = {
A: 0,
B: 1,
@akainth015
akainth015 / lemma_counting.py
Created November 12, 2020 13:11
Count core words in a document
# Spacy is a natural language processing tool to aid with quickly building apps. We can use it, meaning we will have
# to do minimal work on our own
import spacy
if __name__ == '__main__':
# Load the poem from my computer. The text file contains just the content of the poem as is, pasted in with Notepad.
file = open("C:\\Users\\aanand\\Downloads\\How To Tame a Wild Tongue.txt", "r")
poem = file.read()
file.close()