Skip to content

Instantly share code, notes, and snippets.

Avatar

Donnie Clapp dhc02

View GitHub Profile
@dhc02
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)
end
def fib(list, 2) do
Enum.reverse(list)
end
View keybase.md

Keybase proof

I hereby claim:

  • I am dhc02 on github.
  • I am donnieclapp (https://keybase.io/donnieclapp) on keybase.
  • I have a public key ASDh9Trirs4XnirANc1j3Q6PoLWDePS1qlfQiTMsrzdGCAo

To claim this, I am signing this object:

View jquery.drop.js
(function($){
function dragEnter(e) {
$(e.target).addClass("dragOver");
e.stopPropagation();
e.preventDefault();
return false;
};
function dragOver(e) {
e.originalEvent.dataTransfer.dropEffect = "copy";
View jquery.insert.js
(function($){
var insertAtCaret = function(value) {
if (document.selection) { // IE
this.focus();
sel = document.selection.createRange();
sel.text = value;
this.focus();
}
else if (this.selectionStart || this.selectionStart == '0') {
var startPos = this.selectionStart;
@dhc02
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
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 http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/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
Delivered-To: dhclapp@gmail.com
Received: by 10.229.12.133 with SMTP id x5cs178836qcx;
Mon, 26 Jul 2010 12:46:46 -0700 (PDT)
Received: by 10.151.93.19 with SMTP id v19mr141766ybl.381.1280173601178;
Mon, 26 Jul 2010 12:46:41 -0700 (PDT)
Received-SPF: neutral (google.com: 209.142.136.105 is neither permitted nor denied by best guess record for domain of MAILER-DAEMON) client-ip=209.142.136.105;
Received: by 10.190.4.196 with POP3 id 4mf308372yxp.131;
Mon, 26 Jul 2010 12:46:40 -0700 (PDT)
X-Gmail-Fetch-Info: donniec@skiwhitefish.com 1 mail.nw.centurytel.net 110 wspt152
Return-Path: <MAILER-DAEMON>
View userChrome.css
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
/* * For more examples see http://www.mozilla.org/unix/customizing.html */
#appmenu-button-container{
position: fixed !important;
margin-top: 2px;
}
#navigator-toolbox[tabsontop="true"] #TabsToolbar{
padding-left: 80px !important;
You can’t perform that action at this time.