Skip to content

Instantly share code, notes, and snippets.

Avatar

Eli Mellen eli-oat

View GitHub Profile
@eli-oat
eli-oat / dice.ts
Last active Mar 16, 2021
A dice rolling class
View dice.ts
interface Dice {
numberOfDice: number;
sidesOfDice: number;
diceModifier: number;
}
interface LogEntry {
timestamp: string;
input: string;
result: number;
@eli-oat
eli-oat / test.md
Created Jan 3, 2021 — forked from ityonemo/test.md
Zig in 30 minutes
View test.md

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@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/*