Skip to content

Instantly share code, notes, and snippets.


Jared Davis Jared-Prime

View GitHub Profile

Original by Bert Hubert

What is life?

This question keeps many people awake at night and has led to rafts of definitions, some involving features (procreation, metabolism and so forth), some involving chemistry, entropy or energy flux and some are of a more philosophical bent. A BBC article noted there are over 100 definitions of life and it claims all are wrong.

And indeed it does appear to be quite a challenge - every hard and fast rule is violated somewhere in biology. There are things that are clearly alive, but never replicate. Plants typically do not move yet are extremely vital. Viruses do make copies of themselves, but need a host to do so. Are they alive? And once you have it all figured out, some wise person comes up with a crystal that somehow manages to create copies of itself, and points out that these copies even ‘inherit’ characteristics. Is the crystal alive? Similarly, “fire” consumes elements, moves and even replicates. Yet calling fire

Jared-Prime / gist:2423065
Created Apr 19, 2012
Converting RGB to HEX in Ruby
View gist:2423065
# Beginning Rubyists: simply run >> ruby hex-convertions.rb to see examples
# or use irb to build the code on the fly
# you can convert HEX to DEC using the method .to_i(base),
# which converts a string to a decimal number from the specified base number
puts "00".to_i(16)
puts "FF".to_i(16)
Jared-Prime / sagemaker-gpu.dockerfile
Last active Mar 6, 2019
Dockerfile for running DonkeyCar training jobs on AWS Sagemaker
View sagemaker-gpu.dockerfile
FROM nvidia/cuda:9.0-base-ubuntu16.04
LABEL maintainer="Jared Davis <>"
# Pick up some TF dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cuda-command-line-tools-9-0 \
cuda-cublas-9-0 \
cuda-cufft-9-0 \
Jared-Prime / grpc.conf
Created Mar 9, 2018
sketch of what a gRPC backend to nginx might look like based off
View grpc.conf
server {
listen 8443 ssl http2;
listen [::]:8443 ssl http2;
ssl_certificate /some/place/server.crt;
ssl_certificate_key /some/place/server.key;
location /internal {
proxy_http_version 2.0;
proxy_pass http://$some_ip:50051;
View loginv.go
package main
import (
// constants and inverse error function
// found from

Keybase proof

I hereby claim:

  • I am jared-prime on github.
  • I am 1ijk ( on keybase.
  • I have a public key ASBCiwiAriRMub7tHOVk2ofaXDdmZUIuezlPSBsFSKlFaQo

To claim this, I am signing this object:

#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o xtrace
View Change.hs
module Change where
data Coin a = Penny a | Nickel a | Dime a | Quarter a deriving (Eq, Ord, Show)
type Coins = [Coin Int]
denominations = [1, 5, 10, 25]
coinCount :: Int -> Int -> Coin Int
coinCount amount denomination
Jared-Prime /
Created Jan 26, 2016 — forked from DrMavenRebe/
Remove unlinked space from the docker drive
#!/usr/bin/env python
Check all existing Docker containers for their mapped paths, and then purge any
zombie directories in docker's volumes directory which don't correspond to an
existing container.
Taken from:
import logging
import os
View handle_recordfile.c
static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, const char * const argv[])
struct ast_filestream *fs;
struct ast_frame *f;
struct timeval start;
long sample_offset = 0;
int res = 0;
int ms;
struct ast_dsp *sildet=NULL; /* silence detector dsp */