- https://watchmycode.com/ - Collaborative code editor. Uses CRDT for multiplayer.
- Emulating Space Invaders in React - Chip-8 Emulator
- Export Medium posts to Gatsby
- Order fresh milk in Cambodia - React Native app App Store link
- Downslide - Swift MacOS app that turns
Markdown -> Slides
- Rewriting Redux from scratch
- Webpack demos for PS course
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use this when you can curl an https server, but node request() will return 'econnreset: socket hang up' | |
var options = { | |
url: 'https://some/site', | |
method: 'POST', | |
// these 3 lines matter | |
strictSSL: false, | |
secureProtocol: 'TLSv1_method', | |
rejectUnhauthorized: false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http') | |
// Expectation: When I curl localhost:3000, I want to be able to | |
var server = http.createServer(function (req, res) | |
res.statusCode = 200; | |
res.write(e.stack); // throws exception | |
res.end() | |
}) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// simple example of how to create a function that calls a middleware chain, similar to express middleware | |
var req = {type: "req"}; | |
var res = {type: "res"}; | |
// 3 middlewares | |
var first = function(req, res, next) { | |
req.first = true; //easy way to verify that all have been executed | |
res.first = true; | |
return next(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
slug: introducing-the-react-testing-library | |
date: 2019-02-18 | |
title: Introducing the react-testing-library 🐐 | |
description: "NOTE: This is a cross-post from my newsletter. I publish each email two weeks after it’s sent. Subscribe to get more content like this earlier right in your inbox! 💌 Two weeks ago, I wrote a new…" | |
categories: ['React'] | |
keywords: [React,JavaScript,Testing] | |
banner: './images/banner.jpg' | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Legend of Korra | |
Dragon Prince | |
Trollhunters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get(base, pathQuery, returnOnUndefinedValue) { | |
var pathArr = pathQuery.split('.'); | |
var currentVal = base; | |
for (var i=0; i<pathArr.length; i++) { | |
var key = pathArr[i]; | |
currentVal = currentVal[key]; | |
if (!currentVal) { | |
return returnOnUndefinedValue ; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// More modern version of what's found here by Khan academy: https://github.com/martinandert/react-interpolate-component/blob/master/index.js | |
// 1) simple way to result in <div>Hello</div> | |
let a = React.createElement("div", null, "Hello"); | |
// 2) Create a fragment instead of a div so you can pass in JSX as one of the children. Key is optional I think | |
// <Fragment key="0">Hello my friend, <a href="http://www.cnn.com">This is good</a> </Fragment> | |
let b = React.createElement( | |
React.Fragment, {key: 0}, | |
"hello my friend ", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
# byobu's tmux f-key keybindings | |
# | |
# Copyright (C) 2011-2014 Dustin Kirkland <kirkland@byobu.co> | |
# | |
# Authors: Dustin Kirkland <kirkland@byobu.co> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, version 3 of the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// weirdness with closures | |
// Setup: pass an obj to a function, and then another function (in my case apollo server) | |
// Test: the thing is executed, then I change the object, then execute again. What is the object value passed in? | |
var mockReqObj = { test: 'jamis' }; | |
// Variation 1) | |
// appears to use default value in console log (for both) | |
mockReqObj = { test: 'NBODOy' }; |