Skip to content

Instantly share code, notes, and snippets.

FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y software-properties-common gpg
RUN add-apt-repository ppa:freecad-maintainers/freecad-daily
const compareId = (a, b) => {
const numberRegex = /\d+/;
const aId = parseInt(a.id.match(numberRegex));
const bId = parseInt(b.id.match(numberRegex));
if (aId < bId) return -1;
if (aId > bId) return 1;
if (aId === bId) return 0;
}
document.querySelector('#synth').style.visibility='hidden'
@drewler
drewler / epd_ipd.c
Created November 10, 2017 18:34
Arduino - IPAddress to char* + e-paper print
char IP[] = "xxx.xxx.xxx.xxx"; // buffer
IPAddress ip = WiFi.localIP();
ip.toString().toCharArray(IP, 16);
paint.DrawStringAt(0, 0, IP, &Font12, COLORED);
epd.SetPartialWindowBlack(paint.GetImage(), 0, 20, paint.GetWidth(), paint.GetHeight());
epd.DisplayFrame();
@drewler
drewler / git-commit-date.sh
Last active July 24, 2017 16:37
Shell function used to force a date when creating a git commit
# The date format can be any valid input string for GNU date tool
# GNU date examples: https://www.gnu.org/software/coreutils/manual/html_node/Examples-of-date.html
# Some usage examples:
# git-commit-date "now +3 hour" --all
# git-commit-date "2 days ago"
# git-commit-date "1933-01-16 22:32:44" -m "Where were you on the night of January the 16th?"
function git-commit-date(){
export GIT_AUTHOR_DATE=`date -d"$1" --rfc-email`