Skip to content

Instantly share code, notes, and snippets.


D.H. Clapp dhc02

View GitHub Profile
dhc02 / Caddyfile-example
Created May 24, 2022
example docker compose and caddy config for plex, radarr, sonarr, etc.
View Caddyfile-example
# Some services use paths on my main domain, such as home.domain/sonarr.
# Others use subdomains, such as plex.home.domain.
# If I were starting over, I'd use all subdomains. Caddy just magically
# obtains SSL certificates for subdomains, some services require some
# extra work and configuration to work at a path.
dhc02 / fibonacci.ex
Created Sep 19, 2018
Fibonacci sequence in Elixir
View fibonacci.ex
defmodule Fibonacci do
def find(nth) do
list = [1, 1]
fib(list, nth)
def fib(list, 2) do

Keybase proof

I hereby claim:

  • I am dhc02 on github.
  • I am donnieclapp ( on keybase.
  • I have a public key ASDh9Trirs4XnirANc1j3Q6PoLWDePS1qlfQiTMsrzdGCAo

To claim this, I am signing this object:

View jquery.drop.js
function dragEnter(e) {
return false;
function dragOver(e) {
e.originalEvent.dataTransfer.dropEffect = "copy";
View jquery.insert.js
var insertAtCaret = function(value) {
if (document.selection) { // IE
sel = document.selection.createRange();
sel.text = value;
else if (this.selectionStart || this.selectionStart == '0') {
var startPos = this.selectionStart;
dhc02 / gist:4487729
Last active Dec 10, 2015
Ruby script to iterate over files and subdirectories in directorie[s] given as arguments and add raw text of those files to merged.txt in the working directory where the script is called
View gist:4487729
# Command line script which iterates over files and subdirectories in directorie[s] given as arguments
# and adds raw text of those files to merged.txt in the working directory where the script is called.
# When called subsequent times from the same working directory, merged.txt will be appended
# Call like this:
# ruby merge.rb {absolute path portion to delete} {directory to scan} [{directory to scan}]
# For example:
# ruby merge.rb /Users/donnieclapp/Projects/ ~/Projects/htl-website/myproject/static_media/stylesheets
dhc02 / ThinkUp on EC2 Ubuntu 10.10 User-Data Script
Created Apr 22, 2011 — forked from waxpancake/ThinkUp on EC2 Ubuntu User-Data Script
Install script for non-interactively installing ThinkUp and prerequisites
View ThinkUp on EC2 Ubuntu 10.10 User-Data Script
#!/bin/bash -ex
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
# install ThinkUp on EC2 Ubuntu instance:
# @spara 12/23/10
# @waxpancake 1/3/11
# install required packages
sudo apt-get update
View rails server backtrace
=> Booting WEBrick
=> Rails 3.0.4 application starting in development on
=> Call with -d to detach
=> Ctrl-C to shutdown server
/home/donnie/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.4/lib/abstract_controller/base.rb:114:in `process': The action 'method' could not be found for ActionMailer::Base (AbstractController::ActionNotFound)
from /home/donnie/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.4/lib/abstract_controller/rendering.rb:41:in `process'
from /home/donnie/.rvm/gems/ruby-1.9.2-p136/gems/actionmailer-3.0.4/lib/action_mailer/old_api.rb:75:in `process'
from /home/donnie/.rvm/gems/ruby-1.9.2-p136/gems/actionmailer-3.0.4/lib/action_mailer/base.rb:448:in `process'
from /home/donnie/.rvm/gems/ruby-1.9.2-p136/gems/actionmailer-3.0.4/lib/action_mailer/base.rb:443:in `initialize'
View new case statement.php
<? case (preg_match("/test\.php/i", $_SERVER['REQUEST_URI']) ? true : false) : ?>
View bad email
Received: by with SMTP id x5cs178836qcx;
Mon, 26 Jul 2010 12:46:46 -0700 (PDT)
Received: by with SMTP id v19mr141766ybl.381.1280173601178;
Mon, 26 Jul 2010 12:46:41 -0700 (PDT)
Received-SPF: neutral ( is neither permitted nor denied by best guess record for domain of MAILER-DAEMON) client-ip=;
Received: by with POP3 id 4mf308372yxp.131;
Mon, 26 Jul 2010 12:46:40 -0700 (PDT)
X-Gmail-Fetch-Info: 1 110 wspt152
Return-Path: <MAILER-DAEMON>