Skip to content

Instantly share code, notes, and snippets.

View jdavis's full-sized avatar
💾

Josh Davis jdavis

💾
View GitHub Profile
# 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 March 31, 2015 20:43
Python Functional Puzzle
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:
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 August 29, 2015 14:02
Statistics of Neovim Git repo using gitinspector on 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 August 29, 2015 14:01
Keybase.io Verification

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 December 28, 2013 21:23
Simple init.d Service script to start a tshock Terraria Server
#!/bin/sh
#
# Terraria Config
#
# Tmux session ID
SESSION=terraria
# Username to run as
@jdavis
jdavis / AREADME.md
Last active December 28, 2015 17:59

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:

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 December 16, 2015 11:29
Set of simple tests for the second project of Computer Science 352 at Iowa State University.
#!/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 April 17, 2013 12:03
Example of the Adapter Design Pattern in glorious Python code.
"""
Example of the Adapter Design Pattern
"""
class RocketShip(object):
def turnOn(self):
raise NotImplementedError()