Skip to content

Instantly share code, notes, and snippets.

Avatar

Eli Mellen eli-oat

View GitHub Profile
@eli-oat
eli-oat / lbForth.c
Created Sep 7, 2020 — forked from lbruder/lbForth.c
A minimal Forth compiler in ANSI C
View lbForth.c
/*******************************************************************************
*
* A minimal Forth compiler in C
* By Leif Bruder <leifbruder@gmail.com> http://defineanswer42.wordpress.com
* Release 2014-04-04
*
* Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial
*
* PUBLIC DOMAIN
*
@eli-oat
eli-oat / html.lisp
Created Jul 26, 2020 — forked from markasoftware/html.lisp
html->string (Super simple HTML templating for Lisp)
View html.lisp
(defvar *html-void-tags* '(:area :base :br :col :embed :hr :img :input :link
:meta :param :source :track :wbr)
"String designators for self-closing/void tags.
https://html.spec.whatwg.org/multipage/syntax.html#void-elements")
(defvar *html-escapes*
'(#\& "&amp;"
#\< "&lt;"
#\> "&gt;"
#\" "&quot;"))
@eli-oat
eli-oat / clean.el
Created May 15, 2020 — forked from rougier/clean.el
A very minimal but elegant emacs configuration file
View clean.el
(require 'org)
(setq-default indent-tabs-mode nil)
(setq org-display-inline-images t)
(setq org-redisplay-inline-images t)
(setq org-startup-with-inline-images "inlineimages")
(setq default-frame-alist
(append (list '(width . 72) '(height . 40))))
View 2020-05-01_website.css
:root{
--prime-color:#464646;
--prime-bg:#fffceb;
--dark-bg:#2d2d2d;
--link-pink:#f012be;
--link-yellow:#ffb700;
--pink:rgba(255, 105, 180, 0.5);
--blue:rgba(48, 79, 254, 0.5);
--silver:#c1c1c1
}
@eli-oat
eli-oat / pomodoro.lua
Last active Apr 19, 2020
A teeny tiny pomodoro timer
View pomodoro.lua
-- title: pomo
-- author: eli_oat
-- about: a very tiny pomodoro timer
defaults = {
pomoTime = 1500, -- length of a pomodoro in seconds
restTime = 600, -- length of a short rest in seconds
longRestTime = 900, -- length of a long rest in secconds
pomoCount = 0, -- tracks the number of elapsed pomodoros
@eli-oat
eli-oat / watch.sh
Created Apr 10, 2020
macOS bash function to trigger an alert when a process completes
View watch.sh
watch(){
cmd=$@ # Somehow interpolate $@ directly doesn't work.
$@ && tput bel && osascript -e "display notification \"Completed: $cmd\" with title \"╚(•⌂•)╝ Watch Alert\""
}
@eli-oat
eli-oat / MakeActiveChartOverlapRange.bas
Created Apr 9, 2020 — forked from mjdescy/MakeActiveChartOverlapRange.bas
Make active Excel chart overlap a range completely
View MakeActiveChartOverlapRange.bas
Option Explicit
Public Sub SetActiveChartToCompletelyCoverARange()
Call ResizeAndRepositionChart( _
Chart:=ActiveChart, _
Range:=AskUserToInputARange())
End Sub
Private Sub ResizeAndRepositionChart(ByRef Chart As Excel.Chart, ByRef Range As Excel.Range)
If Chart Is Nothing Then
View imagemagick-dither.sh
mogrify -path DESTINATIONFOLDER -filter Triangle -define filter:support=2 -thumbnail 1200 -unsharp 0.25x0.08+8.3+0.045 -dither FloydSteinberg -type Grayscale -colors 2 -posterize 136 -quality 82 -define jpeg:fancy-upsampling=off -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=1 -define png:exclude-chunk=all -interlace none -colorspace sRGB SOURCEFOLDER/*
@eli-oat
eli-oat / dice.js
Created Feb 20, 2020
Roll the dice | simple code that can parse standard dice notation (e.g. '2d20+3') and return a more or less random result within that range
View dice.js
"use strict";
const dice = {
validate: (diceNotation) => {
const match = /^(\d+)?d(\d+)([+-]\d+)?$/.exec(diceNotation);
if (!match) {
throw "Invalid dice notation: " + diceNotation;
} else {
return match;
@eli-oat
eli-oat / ldb.js
Created Feb 7, 2020
An itsy-bitsy database for the browser. useful for web apps and other toy projects.
View ldb.js
/* =============================
================================
/$$ /$$ /$$
| $$ | $$| $$
| $$ /$$$$$$$| $$$$$$$
| $$ /$$__ $$| $$__ $$
| $$| $$ | $$| $$ \ $$
| $$| $$ | $$| $$ | $$
| $$| $$$$$$$| $$$$$$$/
You can’t perform that action at this time.