Skip to content

Instantly share code, notes, and snippets.

View bradparks's full-sized avatar

Brad Parks bradparks

  • Fredericton, New Brunswick, Canada
View GitHub Profile
@bradparks
bradparks / pandoc.css
Created February 7, 2024 01:05 — forked from killercup/pandoc.css
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@bradparks
bradparks / bashfile
Created January 16, 2024 22:46 — forked from lwneal/bashfile
#!/usr/bin/echo calm down it's just a shebang
#!/bin/bash
# ^
# There's nothing magical about shebang (#!) lines- they just tell the shell which executable should be used to run this script
# The <<EOF syntax is called a heredoc (https://en.wikipedia.org/wiki/Here_document)
# It allows us to conveniently cat a large amount of text
# Let's use a heredoc to write the Dockerfile
cat >Dockerfile <<'EOF'
# syntax = docker/dockerfile:1.4.0
@bradparks
bradparks / Dockerfile
Created January 16, 2024 22:43 — forked from adtac/Dockerfile
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@bradparks
bradparks / About Search.jpg
Created June 21, 2023 00:02 — forked from ryanlucas/About Search.jpg
Unlocking iPhone 8 iOS 11
About Search.jpg
@bradparks
bradparks / falsehoods-programming-time-list.md
Created September 2, 2022 12:18 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@bradparks
bradparks / activetable.js
Created July 12, 2022 11:43 — forked from stevesouders/activetable.js
ActiveTable is a bookmarklet that makes any table sortable. It also allows you to remove columns, and it remembers the removed columns for next time. Use alt+click to UNhide all columns (and clear memory). To use it, create a bookmark called "ActiveTable" that has this URL: javascript:(function(){ var jselem=document.createElement('SCRIPT'); jse…
// ActiveTable - a bookmarklet to make tables sortable and editable
function init() {
var aHrows = getHrows();
var numHrows = aHrows.length;
var aHidden = getHiddenColumns();
ATpopup = document.createElement("div");
ATpopup.style.cssText = "position: absolute; visibility: hidden; padding: 0; font-family: Arial; background-color: rgba(255, 255, 255, 0.9); border-radius: .5em; text-align: center; box-shadow: .05em .05em .5em #00C;";
ATpopup.innerHTML = "<a href='sort' title='sort' onclick='sortColumn(); return false'><img border=0 src='http://stevesouders.com/images/sort_up_down.png' style='padding-top: 0.2em;'></a><br><a href='hide' style='color: #C00; font-family: monospace; font-size: 1.5em; text-decoration: none;' title='hide' onclick='hideColumn(); return false'>x</a>"; // TODO - use protocol-less URL for img
@bradparks
bradparks / console.py
Created March 3, 2022 19:44 — forked from j1o1h1n/console.py
This is a demo of an interactive console in a Textual user interface.
from __future__ import annotations
import string
import code
import sys
import io
from typing import Callable
from textual.app import App
from textual.widgets import Header, ScrollView
@bradparks
bradparks / Docker
Created September 2, 2021 11:49 — forked from mitchwongho/Docker
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash