Skip to content

Instantly share code, notes, and snippets.

View hemepositive's full-sized avatar

Jonathan White, MD hemepositive

  • Huntsville Hospital
  • Huntsville, AL
View GitHub Profile
@hemepositive
hemepositive / obsidian_tips.txt
Created March 11, 2023 00:21
Obsidian tip and quick reference
Things Theme
```
## Basic
- [ ] to-do
- [/] incomplete
- [x] done
- [-] canceled
- [>] forwarded
- [<] scheduling
@hemepositive
hemepositive / replacespaceswithcommas.txt
Last active October 4, 2021 19:17
Replace spaces with comma with Linux
sed 's/ /,/g' temp.txt >newtemp.txt
@hemepositive
hemepositive / handler.js
Last active June 9, 2021 12:53
React Generic Change Handlers
// https://www.taniarascia.com/crud-app-in-react-with-hooks/
const handleInputChange = (event) => {
const { name, value } = event.target
setUser({ ...user, [name]: value })
}
===============================================================================================================
// !! https://www.pluralsight.com/guides/handling-multiple-inputs-with-single-onchange-handler-react
@hemepositive
hemepositive / .jshintrc
Created January 9, 2021 00:38
jshintrc
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
@hemepositive
hemepositive / reducer.txt
Created December 10, 2020 20:46
Reducer Pattern useReducer React Notes
const [state, dispatch] = useReducer(reducer, initialState);
------------------------------------------------------------------------------------------------
DEFINITIONS:
Reducers ->
- Reducers are functions that take input and decide what to do it with it in one central spot.
- Reducers return one thing => state
- Redux Reducers™️ are a specific usage of reducers that interpret events in your application, and how that changes application state.
Actions -> Actions are objects that describe an event
@hemepositive
hemepositive / fakeMedData.json
Last active November 23, 2020 16:30
fake med data
[
{
"id": 1,
"started": "2018-01-20T06:00:00.000Z",
"active": true,
"name": {
"trade": "Coreg",
"generic": "carvedilol"
},
"doses": ["3.125", "6.25", "12.5"],
@hemepositive
hemepositive / drugs.js
Created November 22, 2020 20:15
drug list
Drugs = new Mongo.Collection('drugs');
drugs= [
"Acetazolamide Injection 500 mg",
"Acetazolamide Tablet 250 mg",
"Acetylcysteine Injection 200 mg/mL",
"Acetylsalicylic Acid Tablet 300 mg",
"Acetylsalicylic Acid Tablet 75 mg (Dispersible)",
"Activated Charcoal Powder 50 g",
"Acyclovir Cream 5%",
// normal notes
@notes=qw{A A# B C C# D D# E F F# G G#};
printf("%-3s %8.3f\n",
sprintf("%s%d", $notes[($_)%12], int(($_+9)/12)),
27.5 * 2**($_/12)) for (0 .. 87)'
// quarter tones
@notes = qw { A A# B C C# D D# E F F# G G# };
printf("%-4s %8.3f\n",
sprintf("%s%s%d", $notes[$_ % 12], ((int($_) == $_) ? "" : "+"), int(($_ + 9) / 12)),
@hemepositive
hemepositive / output.txt
Created November 15, 2020 22:15
quarter notes
A0 27.500
undefined+0 28.306
A#0 29.135
undefined+0 29.989
B0 30.868
undefined+0 31.772
C1 32.703
undefined+1 33.661
C#1 34.648
undefined+1 35.663
@hemepositive
hemepositive / music-notes.html
Last active November 14, 2020 18:43
music.js
<script>
var convert = function () {
document.getElementById("result").innerHTML =
"<font face=\"Geneva, Arial, Helvetica, sans-serif\">" +
frequencyToNote() + "</font>";
}
var frequencyToNote = function () {
var input = Number(document.getElementById("frequency").value);
if(isNaN(input) || (input == 0))