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 / 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 / package-json-build-number.ps1
Created May 31, 2018 15:10 — forked from ediblecode/package-json-build-number.ps1
Powershell script to parse a package.json version and use as the build number in TeamCity
$version = (Get-Content package.json) -join "`n" | ConvertFrom-Json | Select -ExpandProperty "version"
$buildCounter = "%build.counter%"
$buildNumber = "$version.$buildCounter"
Write-Host "##teamcity[buildNumber '$buildNumber']"
@dannyrb
dannyrb / @ BroadcastChannel Polyfill.md
Created December 29, 2017 20:49
BroadcastChannel Polyfill

BroadcastChannel Polyfill

BroadcastChannel is a new communication API proposed in the HTML Standard but not yet widely implemented. It allows messages to be sent to all other BroadcastChannel instances sharing the same channel name within the same browsing context and origin.

var bc = new BroadcastChannel('name');

bc.postMessage(payload);
@dannyrb
dannyrb / blog.md
Created December 16, 2017 01:04 — forked from JacobBennett/blog.md
Clean up your Vue modules with ES6 Arrow Functions

Recently when refactoring a Vue 1.0 application, I utilized ES6 arrow functions to clean up the code and make things a bit more consistent before updating to Vue 2.0. Along the way I made a few mistakes and wanted to share the lessons I learned as well as offer a few conventions that I will be using in my Vue applications moving forward.

The best way to explain this is with an example so lets start there. I'm going to throw a rather large block of code at you here, but stick with me and we will move through it a piece at a time.

<script>

// require vue-resource...

new Vue({