Skip to content

Instantly share code, notes, and snippets.

@anbcodes
anbcodes / inlineCodeHighlighting.js
Created September 23, 2019 17:54
A Script to paste into the javascript console on Stackedit.io to add inline code highlighting using this format: `your code`lang! (only works when exported)
GLOBALREPLACE = true
document.getElementsByClassName('hidden-rendering-container')[1].addEventListener("DOMSubtreeModified", (e) => {
setTimeout(() => {GLOBALREPLACE = true}, 50)
if (GLOBALREPLACE) {
console.log(e.target.innerHTML)
e.target.innerHTML = e.target.innerHTML.replace(/(<code>)(.*?)(<\/code>)(.*?)(!)/g, (s, p1, p2, p3, p4) => `<code class="prism language-${p4}">${p2}</code>`)
console.log("AFTER")
console.log(e.target.innerHTML)
}
GLOBALREPLACE = false
@anbcodes
anbcodes / dBm_recorder.py
Created January 21, 2019 22:52
A simple program to record the WiFi signal in dBm for 15 seconds on ubuntu 18.04
import subprocess
import time
TSL = []
counter = 0
ATSL = []
counter2 = 0
filename = input("filename:\n")
f = open("{}.txt".format(filename), 'w')
print("writting outputs to {}".format(filename))
print()