Skip to content

Instantly share code, notes, and snippets.

View TheMcMurder's full-sized avatar
🐙

Justin McMurdie TheMcMurder

🐙
View GitHub Profile
@TheMcMurder
TheMcMurder / README.md
Last active August 23, 2021 16:49
One potential way to handle a snackbar queue using react and rxjs

notification service

A centralized API for dispatching notifications through Snackbars and Banners.

API

triggerSnackbar

Triggers a Snackbar that is displayed to the user.

@TheMcMurder
TheMcMurder / iframe-example.ts
Last active August 4, 2020 19:49
Example of the post message set-up in Angular 9
import { Component } from '@angular/core';
import { Router, NavigationStart, Event as NavigationEvent } from '@angular/router';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
constructor(
import React, { useEffect, useRef } from "react";
// import { BrowserRouter, Route, Switch, Redirect } from "react-router-dom";
// import PeoplePage from "./people-page/people-page.component.js";
export default function Root(props) {
const iframeRef = useRef()
useEffect(() => {
setTimeout(() => {
iframeRef.current.contentWindow.postMessage(
{ source: 'quicksilver', pathname: window.location.pathname.replace('/people/', '') },
@TheMcMurder
TheMcMurder / machine.js
Last active May 7, 2020 15:14
Generated by XState Viz: https://xstate.js.org/viz
const alwaysClasses = 'px-4 rounded'
const primaryAlways = `text-white`
const secondaryAlways = `bg-transparent border`
const buttonMachine = Machine(
{
id: 'button',
initial: 'active',
on: {
CHOOSE_BTN_TYPE: {
@TheMcMurder
TheMcMurder / index.html
Created December 31, 2019 22:28
Working SystemJS and rxjs
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title></title>
<script src='https://cdn.jsdelivr.net/npm/systemjs@6.1.5/dist/system.js'></script>
<script src='https://cdn.jsdelivr.net/npm/systemjs@6.1.5/dist/extras/amd.js'></script>
<script src='https://cdn.jsdelivr.net/npm/systemjs@6.1.5/dist/extras/named-exports.js'></script>
<script src='https://cdn.jsdelivr.net/npm/systemjs@6.1.5/dist/extras/named-register.js'></script>
@TheMcMurder
TheMcMurder / index.html
Last active February 19, 2020 16:36
Working rxjs
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title></title>
<script src='https://cdn.jsdelivr.net/npm/systemjs@6.2.3/dist/system.js'></script>
<script src='https://cdn.jsdelivr.net/npm/systemjs@6.2.3/dist/extras/amd.js'></script>
<script src='https://cdn.jsdelivr.net/npm/systemjs@6.2.3/dist/extras/named-exports.js'></script>
<script src='https://cdn.jsdelivr.net/npm/systemjs@6.2.3/dist/extras/named-register.js'></script>

Keybase proof

I hereby claim:

  • I am themcmurder on github.
  • I am themcmurder (https://keybase.io/themcmurder) on keybase.
  • I have a public key ASBsudOEjuLEMRKrW_viIQH_mFPqEaodniID2XmpyozXEgo

To claim this, I am signing this object:

@TheMcMurder
TheMcMurder / app.js
Created June 16, 2015 23:39
Crazy d3 enter exit update example
var data =[45, 10];
init();
//creating the svg so I can draw objects on it
var svg = d3.select("body").append("svg")
.attr("width", 500)
.attr("height", 5000);
@TheMcMurder
TheMcMurder / index.html
Created June 16, 2015 23:36
d3 Nest data example
<!DOCTYPE html>
<html>
<head>
<title>Nested Data example </title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" charset="utf-8"></script>
<script src="nested.js"></script>