Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin McMurdie TheMcMurder

View GitHub Profile
@TheMcMurder
TheMcMurder / iframe-example.ts
Last active Aug 4, 2020
Example of the post message set-up in Angular 9
View iframe-example.ts
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(
View iframe-example.js
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/', '') },
View machine.js
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 Dec 31, 2019
Working SystemJS and rxjs
View index.html
<!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>
View index.html
<!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>
View keybase.md

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 Jun 16, 2015
Crazy d3 enter exit update example
View app.js
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 Jun 16, 2015
d3 Nest data example
View index.html
<!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>
@TheMcMurder
TheMcMurder / index.html
Last active Sep 25, 2015
Simple Line Chart
View index.html
<!DOCTYPE html>
<html>
<style type="text/css">
.axis path,
.axis line {
fill: none;
stroke: #000;
shape-rendering: crispEdges;
}
You can’t perform that action at this time.