Skip to content

Instantly share code, notes, and snippets.

@archisgore
archisgore / applyTagAt
Created August 18, 2019 19:48
Apply HTML tags across spans of text using Javascript.
function applyTagAt(text, start, end, startTag, endTag) {
var text2 = "";
var counter = 0;
var intag = false;
var inescape = false;
var tagstarted = false;
for (var i = 0; i < text.length; i++) {
if (text.charAt(i) == '<') {
@archisgore
archisgore / alice-vs-bob-payoff-matrix
Created November 23, 2018 18:49
blog-post-table-2
+-----------------------+---------------------+-----------------------------+
| | Dr. Alice | Dr. Bob |
+-----------------------+---------------------+-----------------------------+
| When done correctly | | Strives to cure in 24 hours |
| | | Has success references |
| | | Some rules to follow |
| | | Does not want to fail |
| --------------------- | ------------------- | --------------------------- |
| When done Incorrectly | Will cure Influenza | |
| | Might take 8 days | |
@archisgore
archisgore / alice-vs-bob-benefit-matrix
Last active November 23, 2018 18:34
blog-post-table-1.txt
+----------+---------------------+-----------------------------+
| | Dr. Alice | Dr. Bob |
+==========+=====================+=============================+
| Benefits | Will cure Influenza | Strives to cure in 24 hours |
| | Might take 8 days | Has success references |
| | No rules to follow | Some rules to follow |
| | Plans for failure | Does not want to fail |
+----------+---------------------+-----------------------------+
@archisgore
archisgore / forproc
Last active May 9, 2018 14:39
For all processes with an command, run this command under their /proc/<pid>
function filter_pids() {
oifs="$IFS"
IFS=$'\n'
for stuff in $1; do
if [[ -f $stuff/cmdline ]]; then
echo "$stuff"
fi
done
IFS="$oifs"
[
{
"id": "LW107",
"name": "Dowell",
"lat": "47.630226",
"lng": "-122.270691",
"explored": "YES",
"depth": "-59.20",
"desc": "Wreck",
"documented": "YES",