Skip to content

Instantly share code, notes, and snippets.


Robert Gonzales robertgonzales

View GitHub Profile

Keybase proof

I hereby claim:

  • I am robertgonzales on github.
  • I am robricgon ( on keybase.
  • I have a public key whose fingerprint is F694 40F4 23C1 1109 3103 DC8A 4FFA 3FD9 09CF 172D

To claim this, I am signing this object:

robertgonzales / 1-helloworld.html
Last active Sep 14, 2018
React in the browser, no build step necessary.
View 1-helloworld.html
<title>React Hello World</title>
<div id="app"></div>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script type="text/babel">
robertgonzales / await-all.js
Created Jan 11, 2018
Promise.all using only async await.
View await-all.js
const delay = ms => new Promise(r => setTimeout(r, ms))
async function AwaitAll() {
try {
const promises = [
for (let p of promises) await p
robertgonzales / Frame.js
Created Dec 12, 2017
Use React portals to render inside shadow dom and iframes
View Frame.js
class Frame extends Component {
componentDidMount() {
this.iframeHead = this.node.contentDocument.head
this.iframeRoot = this.node.contentDocument.body
render() {
const { children, head, } = this.props
return (
robertgonzales / App.jsx
Last active Mar 26, 2020
How to make a custom Prompt (using getUserConfirmation) for React Router v4
View App.jsx
// use Prompt like normal... magic happens in getUserConfirmation
class App extends Component {
render () {
return (
<Router getUserConfirmation={getUserConfirmation}>
message="Are you sure you want to leave?"