Skip to content

Instantly share code, notes, and snippets.

View rileyhilliard's full-sized avatar

Riley Hilliard rileyhilliard

View GitHub Profile
@rileyhilliard
rileyhilliard / class-example.ts
Last active April 13, 2019 00:15
Class Example
// Example of a valid class instantiation that contains
// all the required class constructor object properties
import Person from 'person';
// Create a new person of the shape defined by our interfaces
const john = new Person ({
first: 'John',
last: 'Doe',
geo: {
country: 'USA',
@rileyhilliard
rileyhilliard / class-error-example.ts
Last active April 13, 2019 00:15
Class Error Example
// Example of a class instantiation that is missing
// required class constructor object properties
import Person from 'person';
// Create a new person that is missing required object structures
const jane = new Person ({
first: 'Jane',
// Type Error! Property 'last' is missing
// Type Error! Property 'geo' is missing
});
@rileyhilliard
rileyhilliard / controllers.application.js
Last active September 13, 2019 21:05
Debounced Event Test
import Ember from 'ember';
import { debounce } from '@ember/runloop';
// This isnt totally necessary, but in the real world where an error.message might be really
// long it might be better to reduce the stored key to something more consistant
function hasher(str) {
var hash = 0, i, chr;
if (str.length === 0) return hash;
for (i = 0; i < str.length; i++) {
chr = str.charCodeAt(i);
@rileyhilliard
rileyhilliard / controllers.application\.js
Created September 21, 2020 20:29
conditional helper
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
@rileyhilliard
rileyhilliard / controllers.application\.js
Last active January 28, 2021 21:52
router.transitionTo() Twiddle
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
@rileyhilliard
rileyhilliard / controllers.application\.js
Last active July 15, 2021 00:30
Parent Child model data lookup
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
@rileyhilliard
rileyhilliard / prompt.py
Created February 11, 2025 18:26
Example WebAI LLM Chatbot interaction via python in the terminal
# This module demonstrates that it's possible to leverage WebAI to host an LLM chatbot,
# interacting with it via APIs. The code sends a prompt to the LLM and streams back its response.
# In theory, this approach can be extended to programmatically interact with the LLM,
# while using WebAI to orchestrate running the LLM across a cluster of local hardware.
# Demo: https://i.ibb.co/jkNF488Z/Feb-11-2025-12-17-22.gif
import json
import requests
import time
def get_endpoints():
@rileyhilliard
rileyhilliard / data.csv
Created March 21, 2026 03:27
CMS National Health Expenditure per capita, 1960-2024
year per_capita_spending total_spending_billions population_millions
1960 146 27.1 186
1961 154 29.1 189
1962 165 31.8 192
1963 178 34.6 195
1964 194 38.2 197
1965 208 41.6 200
1966 227 45.8 202
1967 251 51.2 204
1968 282 58 206
@rileyhilliard
rileyhilliard / data.csv
Created March 23, 2026 18:54
Commonwealth Fund Mirror Mirror healthcare system rankings 2017-2024
year country country_code domain rank num_countries
2017 United Kingdom GBR Overall 1 11
2017 Australia AUS Overall 2 11
2017 Netherlands NLD Overall 3 11
2017 New Zealand NZL Overall 4 11
2017 Norway NOR Overall 4 11
2017 Sweden SWE Overall 6 11
2017 Switzerland CHE Overall 6 11
2017 Germany DEU Overall 8 11
2017 Canada CAN Overall 9 11
@rileyhilliard
rileyhilliard / data.csv
Created March 23, 2026 18:56
CMS National Health Expenditure by Category, 1960-2024 (millions USD)
category year spending_millions
Dental Services 1960 1987.0
Dental Services 1961 2104.0
Dental Services 1962 2225.0
Dental Services 1963 2372.0
Dental Services 1964 2617.0
Dental Services 1965 2819.0
Dental Services 1966 2993.0
Dental Services 1967 3447.0
Dental Services 1968 3707.0