Skip to content

Instantly share code, notes, and snippets.

View joshterrill's full-sized avatar

Josh Terrill joshterrill

View GitHub Profile
@joshterrill
joshterrill / Fast.ai install script
Created October 19, 2018 17:51 — forked from gilrosenthal/Fast.ai install script
Fast.ai Install on Google Colab
!pip install fastai
!apt-get -qq install -y libsm6 libxext6 && pip install -q -U opencv-python
import cv2
from os import path
from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag
platform = '{}{}-{}'.format(get_abbr_impl(), get_impl_ver(), get_abi_tag())
accelerator = 'cu80' if path.exists('/opt/bin/nvidia-smi') else 'cpu'
!pip install -q http://download.pytorch.org/whl/{accelerator}/torch-0.3.0.post4-{platform}-linux_x86_64.whl torchvision
@joshterrill
joshterrill / index.js
Created September 17, 2018 06:50
a simple Express/NodeJS REST API for verifying medical marijuana patients using the Greenlife verification system.
const express = require('express');
const request = require('request');
const app = express();
const port = process.env.PORT || 3000;
app.get('/:patientId', (req, res) => {
const options = { method: 'GET',
url: 'https://verify.greenlifemedical.com/recommendations',
qs: { utf8: '%E2%9C%93', rec_id: req.params.patientId }
};
{
"name": "usda-ingredients-api",
"version": "1.0.0",
"description": "a REST API for pulling ingredients given a UPC code from ndb.nal.usda.gov",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
@joshterrill
joshterrill / README.md
Created June 13, 2018 08:12
OpenPGP.js browserify javascript methods
  1. Install browserify
npm install -g browserify
  1. Save the pgp.util.js contents to a file.

  2. Run browserify ./pgp.util.js -o ./openpgp.bundle.js

@joshterrill
joshterrill / javascript-programming-cheat-sheet.md
Last active April 27, 2018 02:42
Javascript Programming Cheat Sheet

Programming Cheat Sheet

Javascript Types

  • Strings are defined by encompassing text inside of single or double quotes.
    • let myString = 'some string goes here'
  • Numbers are defined by creating a variable and putting a number in it. It can also have decimal points.
    • let myNumber = 443
  • Arrays are lists of things that are defined by putting items in between square brackets
    • let myArray = [1,2,3,4]
@joshterrill
joshterrill / ticker.py
Created January 8, 2018 06:04 — forked from Krewn/ticker.py
python 3 Stock Ticker with colored text and percent gain since last seen. Requires connection to Yahoo finance API .Includes indices for s&p 500 and NASDAQ
from termcolor import colored
_title = colored("----.----.----^", 'green')
print(_title)
InteractiveVersion = """"""
tickerQ= input('ticker?')
stockGroupSelection = input('Selection(snp | nasdaq):')
stockGroupSelection=stockGroupSelection.lower()
commandLineVersion="""
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@joshterrill
joshterrill / single-left-right-lane.py
Created December 27, 2017 03:26
lane detection example
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
import math
def region_of_interest(img, vertices):
mask = np.zeros_like(img)
match_mask_color = 255 # <-- This line altered for grayscale.
@joshterrill
joshterrill / straight-lines.py
Created December 27, 2017 03:23
lane detection example
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
import math
def region_of_interest(img, vertices):
mask = np.zeros_like(img)
match_mask_color = 255 # <-- This line altered for grayscale.
@joshterrill
joshterrill / shortcode.js
Created November 27, 2017 01:40
shortcode minus jquery
/*
* shortcode.js 1.1.0
* by @nicinabox
* License: MIT
* Issues: https://github.com/nicinabox/shortcode.js/issues
*/
/* jshint strict: false, unused: false */
var Shortcode = function(el, tags) {