Skip to content

Instantly share code, notes, and snippets.


Joshua Cottrell jcottrell

  • The Southern Baptist Theological Seminary
  • Louisville, KY
View GitHub Profile
jcottrell / docker-compose.yml
Last active Jul 13, 2022
Minecraft Bedrock on home wifi
View docker-compose.yml
version: '3.4'
image: itzg/minecraft-bedrock-server
jcottrell / events.json
Created Feb 24, 2021
Fake database for ajax testing
View events.json
"id": 123,
"category": "animal welfare",
"title": "Cat Adoption Day",
"description": "Find your new feline friend at this event.",
"location": "Meow Town",
"date": "January 28, 2022",
"time": "12:00",
"organizer": "Kat Laydee"
jcottrell / encode.hs
Created Jul 10, 2019
Practicing haskell with a short encoding problem to help me create alphabet shifts for my children. Loaded into ghci you would do `encode 1 "Welcome to spy class!"` and get `23-5-12-3-15-13-5 20-15 19-16-25 3-12-1-19-19!`
View encode.hs
module Encode (encode) where
import Data.Char (isAlpha, isDigit, isUpper, toLower)
switchChar :: Int -> Char -> String
-- needs to wrap around if shift is greater than alphabet ??
switchChar shift x =
$ head
$ map snd
jcottrell / index.js
Created Jun 4, 2019
Lambda Calculus in Javascript: Two Lectures by Gabriel Lebec (glebec); notes by jcottrell
View index.js
// Lambda Calculus - Fundamentals of Lambda Calculus & Functional Programming
// Part 1
const inspect = Symbol.for('nodejs.util.inspect.custom')
// Idiot or Identity or Haskell's id
const I = a => a
// Mockingbird (Haskell cannot implement)
View COFFEE-voter.js
javascript:(function(w,d){if(w.location.href===''){d.querySelectorAll('label')[0].click();d.querySelectorAll('form')[0].submit()}setTimeout(()=>{w.location=''},500)}(window, document))
jcottrell / unique-array-from-object-array.js
Created Mar 23, 2017
This is a function I wanted to keep somewhere until I found the library that did it better or had the time to implement ramdajs. It takes a couple functions and an array of objects. It returns an array of objects / values / results based on a unique value.
View unique-array-from-object-array.js
/* ok, ok, I needed a way to get unique values from objects
getUniqueIdFun should be a function that returns the value of what
you want to be unique
getUniquePartFun should be a function that returns the part of the
object you are interested in; it can be undefined, null, empty if
you want the whole object back
objAr should be an array of objects to cull from
const getUniqueObjectsFromArray = (getUniqueIdFun, getUniquePartFun, objAr) => {
const getU = (typeof getUniquePartFun === 'function') ?
jcottrell / jquery-boyce-nav.js
Last active Aug 16, 2016
Using detach to fix View All in navigation
View jquery-boyce-nav.js
var viewAll1 = function (e) {
$me = $(this);
$kids = $me.parent().find('.children').detach();

Keybase proof

I hereby claim:

  • I am jcottrell on github.
  • I am jcottrell ( on keybase.
  • I have a public key whose fingerprint is 1327 7E16 21BB 71AE C8FF 70AA 91BB A621 2504 0A85

To claim this, I am signing this object:

jcottrell /
Created Jun 20, 2016
Run FortiClient on MacOSX and then run El Capitan repair script
sudo echo "Starting FortiClient ..."
/Applications/ > /dev/null 2>&1 &
while [ $secs -gt 0 ]; do
echo -ne "Waiting for you to log into FortiClient: $secs\033[0K\r"
sleep 1
: $((secs--))
echo ""
View Functional Friend Messenger.markdown