Skip to content

Instantly share code, notes, and snippets.

View dannyrb's full-sized avatar
🕵️‍♀️
Looking for a good reason to use GH statuses

Danny Brown dannyrb

🕵️‍♀️
Looking for a good reason to use GH statuses
View GitHub Profile
@dannyrb
dannyrb / advent_of_code_06.js
Created December 7, 2021 17:19
Advent of Code Fishies
const fs = require('fs');
const path = require('path');
const problemPart = 1;
const fileName = `input-${problemPart}.txt`;
const input = fs.readFileSync(path.resolve(__dirname, fileName), 'utf8')
const inputArray = input.split(',').map(x => Number(x));
function timeTravel(fishies, timeTravelDays) {
let fishBirthDayCounts = {
import EVENTS from '../events.js';
import external from '../externalModules.js';
import { getToolState } from '../stateManagement/toolState.js';
import requestPoolManager from '../requestPool/requestPoolManager.js';
import loadHandlerManager from '../stateManagement/loadHandlerManager.js';
import triggerEvent from '../util/triggerEvent.js';
/**
* Scrolls through the stack to the image index requested.
* @export @public @method
@dannyrb
dannyrb / machine.js
Created June 12, 2020 20:56
Generated by XState Viz: https://xstate.js.org/viz
const machineConfiguration = {
id: 'measurementTracking',
initial: 'idle',
context: {
trackedStudy: '',
trackedSeries: [],
},
states: {
off: {
type: 'final',
@dannyrb
dannyrb / machine.js
Created May 26, 2020 20:45
Generated by XState Viz: https://xstate.js.org/viz
// {
// "type": "TRACK_SERIES",
// "StudyInstanceUID": "stu",
// "SeriesInstanceUID": "ser"
// }
const config = {
id: 'measurementTracking',
initial: 'notTracking',
context: {
<!DOCTYPE html>
<html>
<head>
<title>My first Cornerstone Tools app</title>
<!-- Dependencies -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://unpkg.com/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://unpkg.com/[email protected]"></script>
@dannyrb
dannyrb / index.html
Created May 22, 2019 19:48
OHIF-Embedded-v0.1.9
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="description" content="Open Health Imaging Foundation DICOM Viewer" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<meta name="theme-color" content="#000000" />
<meta http-equiv="cleartype" content="on" />
@dannyrb
dannyrb / GraphicOverlays.js
Created January 30, 2019 17:41 — forked from jdnarvaez/GraphicOverlays.js
DICOM Overlays
const overlayGroupTags = [];
for (var i = 0; i <= (0x00ee0000); i += (0x00020000)) {
overlayGroupTags.push((0x60000000 + i));
}
imageRendered(e) {
const eventData = e.detail;
if (eventData && eventData.image && eventData.image.$presentationStateDataSet) {
@dannyrb
dannyrb / index.md
Created October 11, 2018 23:56
Harry Potter World Code Kata

HARRY FREAKIN' POTTER WORLD

  • Create a list of Harry Potter world attractions
  • Include information about each attraction
    • Minimum height to ride in inches (0 if there is no minimum)
    • A short description of the attraction
    • A URL to a picture of the attraction

Using the above information, create the following functions:

@dannyrb
dannyrb / Cornerstone Tools v3 - Hello World
Last active January 27, 2020 16:07
Cornerstone Tool v3 - Simplest example, using Web Image Loader
<!DOCTYPE html>
<html>
<head>
<title>My first Cornerstone Tools app</title>
<!-- Dependencies -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cornerstoneMath.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cornerstone.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cornerstoneWebImageLoader.js"></script>
@dannyrb
dannyrb / my-powershell-friend.ps1
Last active June 2, 2018 16:19
👋 Hi Matt! Hi Pat!
Add-Type -AssemblyName System.speech
$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
$speak.Speak('Come see the violence inherent in the system. Help! Help! I''m being repressed!')
# Nabbed from this reddit thread:
# https://www.reddit.com/r/PowerShell/comments/5z55g4/need_a_fun_prank_script/