Skip to content

Instantly share code, notes, and snippets.

View jumblies's full-sized avatar
🕸️
Focusing

jumblies

🕸️
Focusing
View GitHub Profile
@jumblies
jumblies / dhtSummer.ino
Created March 28, 2017 12:09
Summer Deck lights
// DS1307 RTC ENTRIES ++++++++++++++++
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
#include <Wire.h>
#include "RTClib.h"
RTC_DS1307 rtc;
char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
// DHT11 Temperature and Humidity Sensors
#include "DHT.h" //include DHT library
#define DHTPIN 13 //define as DHTPIN the Pin 10 used to connect the Sensor
@jumblies
jumblies / exam list
Created March 12, 2018 16:28
Radiology Exam List "Dictionary"
The total number of unique studies is 103
Sample size of data is 5489
1 - CR ABDOMEN
2 - CR AC
3 - CR ANKLE
4 - CR BABYGRAM
5 - CR CALCANEUS
6 - CR CHEST
7 - CR CLAVICLE
8 - CR CSPINE
@jumblies
jumblies / counter snippet
Created March 12, 2018 16:35
counter snippet
# Set final initial counters to zero
mriFinal, ctHeadFinal, ctAbdFinal, crFinal, usFinal, ctChestFinal = 0, 0, 0, 0, 0, 0
# Set prelim initial counters to zero ****THIS SNIPPET DOES NOT INCLUDE PRELIM PROCESSING
mriPrelim, ctHeadPrelim, ctAbdPrelim, crPrelim, usPrelim, ctChestPrelim = 0, 0, 0, 0, 0, 0
prelim, final=0,0
finalExceptions = []
prelimExceptions = []
for line in processFile:
@jumblies
jumblies / counter dictionary
Created March 12, 2018 16:51
a list of studies run through the counter builtin function
Counter({'CR CHEST ': 27,
'CT HEAD ': 16,
'CT ABDOMEN ': 11,
'CT CHEST ': 6,
'CT CSPINE ': 5,
'CTA CHEST ': 4,
'US GALLBLADDER / RUQ ': 3,
'CTA NECK ': 3,
'US PELVIS ': 3,
'CTA HEAD ': 2,
@jumblies
jumblies / regex
Created March 21, 2018 09:21
SuperRegex for study parsing with USROC
super_regex = '(?:[\r\n]*)([\'A-Z -\.]*)(?:[\r\n]+)(\[.+||\s])\s*(CURRENT STUDY:[A-Z\s/\[\]]+)([\d-]+)\s([\d:]+)\s(\[DOB:[\s0-9/]+])\s+(\[ID:.+])\s*(?:USE . LINK)\s*(Read Date: \d{4}-\d{2}-\d{2})\s*(Read Time: \d{2}:\d{2}:\d{2})'
@jumblies
jumblies / slowcat.sh
Created August 3, 2018 10:16
slow cat of files
#!/bin/sh
# A program to slowly cat file or standard input.
if [ "$1" ] ; then
file="$1"
else
file="-"
fi
@jumblies
jumblies / scrapy.bat
Created April 1, 2019 15:16
powershell launch
@echo off
start powershell.exe -noexit -command "cd c:\Users\glamke\AppData\Local\Programs\Python\Python37-32\scrapy"; ".\Scripts\activate"; "cd pbike"
@jumblies
jumblies / folder_maker.bat
Created May 4, 2019 14:24
Windows Cascading Directory Creator Batch Commands
:: Folder maker for spawning folders by years
:: generates a list of numbers (start, step, stop) and makes directories for it.
:: Can do a dry run first with DO echo %%G if you want to check it.
FOR /L %%G in (2010,1,2018) DO mkdir %%G
:: For Months
:: FOR /L %%G in (202501,1,202512) DO mkdir %%G
@jumblies
jumblies / boom.ino
Created June 29, 2019 20:13
fireworks
#include <FastLED.h>
#define NUM_LEDS 120
#define DATA_PIN 6
CRGB leds[NUM_LEDS]; // sets up block of memory
#define NUM_SPARKS 61 // max number (could be NUM_LEDS / 2);
float sparkPos[NUM_SPARKS];
float sparkVel[NUM_SPARKS];
float sparkCol[NUM_SPARKS];
float flarePos;
@jumblies
jumblies / gist:ed1c370c9587c40157dbe434970368fa
Created September 1, 2019 21:16
Possible memory leak fix
bool stopPlaying() {
bool stopped = false;
if (rtttl) {
rtttl->stop();
delete rtttl;
rtttl = nullptr;
stopped = true;
}
if (mp3) {
mp3->stop();