Skip to content

Instantly share code, notes, and snippets.

View eli-oat's full-sized avatar

Eli Mellen eli-oat

View GitHub Profile
@eli-oat
eli-oat / clean.el
Created May 15, 2020 22:33 — forked from rougier/clean.el
A very minimal but elegant emacs configuration file
(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))))
: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 April 19, 2020 00:14
A teeny tiny pomodoro timer
-- 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 April 10, 2020 21:11
macOS bash function to trigger an alert when a process completes
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 April 9, 2020 19:19 — forked from mjdescy/MakeActiveChartOverlapRange.bas
Make active Excel chart overlap a range completely
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
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 February 20, 2020 23:57
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
"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 February 7, 2020 18:08
An itsy-bitsy database for the browser. useful for web apps and other toy projects.
/* =============================
================================
/$$ /$$ /$$
| $$ | $$| $$
| $$ /$$$$$$$| $$$$$$$
| $$ /$$__ $$| $$__ $$
| $$| $$ | $$| $$ \ $$
| $$| $$ | $$| $$ | $$
| $$| $$$$$$$| $$$$$$$/
@eli-oat
eli-oat / bashprompt
Created October 31, 2019 18:32
The bash prompt I like to use
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
STAT=`parse_git_dirty`
echo "[${BRANCH}${STAT}] "
else
echo ""
fi
@eli-oat
eli-oat / README.md
Created October 31, 2019 02:43
SCRIPT-8