Skip to content

Instantly share code, notes, and snippets.

View psyllo's full-sized avatar

Benjamin Cluff psyllo

View GitHub Profile
@psyllo
psyllo / wendler531.el
Last active February 18, 2019 07:12
An Elisp function to calculate Wendler 5/3/1 main lift weights and reps given a week number and 1RM.
(defun wendler (week one-rm)
(let ((one-rm (* one-rm 0.9)))
(if (eq week 4)
(mapcar (lambda (n)
(format "%0.2fx5" n))
(list (* one-rm 0.4)
(* one-rm 0.5)
(* one-rm 0.6)))
(let ((pct (+ 0.6 (* week 0.05)))
(reps (cond ((eq week 1) '(5 5 5))
@psyllo
psyllo / scotty_ci.sh
Created January 23, 2014 09:22
Sonian Scotty Launch4j JAR to EXE build automation
#!/usr/bin/env bash
# Synopsis:
# Build a scotty.exe from a scotty.jar using Launch4j
# Helpful docs:
# - http://launch4j.sourceforge.net/docs.html
# - https://gist.github.com/iantruslove/8fe3631fdd14b2417758
# The primary dependencies to resolve are:
@psyllo
psyllo / ssh-agent-start.sh
Created December 13, 2013 05:36
ssh-agent-start.sh - handy for starting an ssh-agent
#!/usr/bin/env bash
#
# Author: Benjamin Cluff - 2013
#
# Synopsis:
#
# Start ssh-agent and create file containing the environment
# variables that can be sourced by .bash_profile so that other ssh
# commands (ssh, ssh-add) can find it.
#
@psyllo
psyllo / .bash_profile.sh
Last active March 19, 2016 14:55
My .bash_profile
# .bash_profile - Benjamin Cluff - 2013
if [ -r $HOME/.profile ]; then
source $HOME/.profile
fi
# More colors for xterm
export TERM=xterm-256color
# Emacs as default editor
@psyllo
psyllo / .bashrc.sh
Last active December 31, 2015 02:19
My .bashrc file with a prompt I wrote for git
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
#
# Benjamin Cluff - 2011-2013
# - Added a handy git prompt
# - Added context specific colors for iTerm2
# - And more
# If not running interactively, don't do anything
@psyllo
psyllo / att-uverse-dsl-status-checker.sh
Created December 11, 2013 21:48
AT&T U-Verse DSL modem/router DSL status checker
#!/usr/bin/env bash
#
# Checks AT&T U-Verse DSL modem for DSL Up/Down status
#
# Compatibility:
#
# Works at least with the following modem/router:
# Manufacturer : Pace Plc
# Model : 3800HGV-B
# Software Version : 6.9.1.42-plus.tm
@psyllo
psyllo / .emacs.el
Created December 6, 2013 17:54
dot-emacs
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(column-number-mode t)
'(custom-enabled-themes (quote (wombat)))
'(global-whitespace-mode t)
'(indent-tabs-mode nil)
'(inhibit-startup-screen t)
@psyllo
psyllo / sort-by-joinin-with-plus
Created January 3, 2011 04:03
Sort a list by joining neighboring elements with +
;;;;
;; Sort a list by joining neighboring elements with `+'
;; This is in exponential time.
;;
;; Pseudo-code:
;;
;; Function "join" (list, max-join-count, join-count) ->
;; Fail if join-count is greater than max-join-count.
;; If the list looks sorted return join-count.
;; For Each number In List