Skip to content

Instantly share code, notes, and snippets.

💾

Josh Davis jdavis

💾
Block or report user

Report or block jdavis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View rename.sh
# Rename a file and keep it in the same location
rename() {
if [ "$#" -ne 2 ]; then
echo "usage: $0 path/to/file/old_name new_name"
return
fi
mv $1 `dirname $1`/$2
}
@jdavis
jdavis / puzzle.py
Created Mar 31, 2015
Python Functional Puzzle
View puzzle.py
def cons(x, y):
return lambda f: f(x, y)
def car(x):
# Fill out this function
pass
if car(cons(1, 5)) == 1:
print 'Solved!'
else:
View output.txt
Provides: {'do_something': <function do_something at 0x102f217d0>, 'do_something_else': <function strange_function_name at 0x102f2b8c0>}
Keybindings: {'t[2, 1]': <function command_t at 0x102f2b9b0>}
do something
doing something else 1337
@jdavis
jdavis / neovim-june-06
Last active Aug 29, 2015
Statistics of Neovim Git repo using gitinspector on June 06
View neovim-june-06
The following historical commit information, by author, was found in the
repository:
Author Commits Insertions Deletions % of changes
Alexander Bolodurin 2 0 144 0.02
Cameron Eagans 2 16 0 0.00
Chris Watkins 6 221 605 0.13
Christian Wellenbroc 1 10 10 0.00
Dane Summers 1 7 5 0.00
David Z. Chen 3 10592 4159 2.24
@jdavis
jdavis / keybase.md
Last active Aug 29, 2015
Keybase.io Verification
View keybase.md

Keybase proof

I hereby claim:

  • I am jdavis on github.
  • I am davis (https://keybase.io/davis) on keybase.
  • I have a public key whose fingerprint is 2FCA 80FF 5F48 C64E E32D 1180 E3BE E893 B4C2 E990

To claim this, I am signing this object:

@jdavis
jdavis / terrariad
Created Dec 28, 2013
Simple init.d Service script to start a tshock Terraria Server
View terrariad
#!/bin/sh
#
# Terraria Config
#
# Tmux session ID
SESSION=terraria
# Username to run as
View AREADME.md

CS311 Homework 6 Tests

Downloading

To use these tests, just use Git and clone them into the directory you have your project.

You can do this using:

View solution.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdavis
jdavis / Project2Tests.sh
Last active Dec 16, 2015
Set of simple tests for the second project of Computer Science 352 at Iowa State University.
View Project2Tests.sh
#!/usr/bin/env sh
#
# Project 2 Tests
# Josh Davis
#
# Overview:
# A few quick and crude tests for project 2.
#
# Running:
# To run it, make sure it has the right permissions:
@jdavis
jdavis / adapter.py
Created Apr 17, 2013
Example of the Adapter Design Pattern in glorious Python code.
View adapter.py
"""
Example of the Adapter Design Pattern
"""
class RocketShip(object):
def turnOn(self):
raise NotImplementedError()
You can’t perform that action at this time.