Skip to content

Instantly share code, notes, and snippets.

@nakulj
nakulj / footnotes.js
Last active March 15, 2023 03:13
Make bloomberg footnotes readable
const $ = q => document.querySelector(q);
const $$ = q => document.querySelectorAll(q);
const num_elements = $$('li.html-footnote').length
console.log(`replacing ${num_elements} items`);
for (i = 1; i <= num_elements; i++) {
console.log(`element ${i}`)
const footnote = $(`#footnote-${i}`).parentElement.querySelector('p');
const m = document.createElement('blockquote');
m.innerHTML = footnote.innerHTML;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nakulj
nakulj / catan-board-generator.markdown
Last active December 31, 2018 07:18
Catan Board Generator
@nakulj
nakulj / TwoPolynomial.py
Last active August 29, 2015 14:13
Polynomial Class
def superscript(num):
superscripts = dict(zip(u"0123456789", u"⁰¹²³⁴⁵⁶⁷⁸⁹"))
return u''.join(superscripts[c] for c in unicode(num))
def str_term(coeff, (p,q)):
if coeff is 0:
return ''
if coeff is 1:
coeff = ''
if p is q is 0: