Skip to content

Instantly share code, notes, and snippets.

@robcmills
robcmills / openspace-tooltip-challenge.md
Last active January 31, 2024 19:12
OpenSpace Frontend React Tooltip Coding Challenge

OpenSpace Frontend Interview React Tooltip Challenge

In order to assess candidates technical competence, especially in React, we ask them to build a Tooltip component.

Challenge 1

challenge 1

Implement the simplest possible version of a Tooltip. Render a "target" div in the center of the screen and on hover show a "tooltip" div to the right of it.

@robcmills
robcmills / engineering-principles.md
Created December 3, 2017 17:54
Engineering Principles

Engineering Principles

Know Why

  • This person works without any interest in why the work is necessary or how it affects the user and system. If changes are requested they don’t have an informed opinion of whether it’s desirable. They’re not sure of how different entities on the network piece together.
  • This person understands the central motivation behind a task, but isn’t aware of enough context to propose changes. They’re aware of the high level goal that this work ties into, but isn’t confident in how this feature advances those goals.
  • This person is confident in the motivation behind a task and how it ties into higher level goals. They ask questions to tease out hidden assumptions and clarify parts of task that are hidden or not examined.
  • This person is able to explain the motivation behind a task and how it ties into a high level goal. They see one step ahead and ask about how it could affect other parts of the product and offer potential solutions when problems exist. They work closely wit
@robcmills
robcmills / pm2-intro.md
Last active November 29, 2017 20:24
PM2 @ BC

PM2

Overview

In production Heroku uses Procfile. pm2 roughly emulates this.

Trace npm start -> node pm2/start.js

Basically pm2/start.js is just a node script that uses pm2's node api to start processes according to the dynamically imported config.

@robcmills
robcmills / atomic-emails-demo.md
Last active November 13, 2017 18:30
Atomic Emails - BC 2017
@robcmills
robcmills / smart-component-style.js
Created August 26, 2016 20:36
smart component style - class vs functional with flow and lifecycle
// https://github.com/BuildingConnected/client/pull/1648
// apps/main/new-prequals/dashboard/vendor/modal/notes.js
const Notes = ({
...props,
}) => (
<div className={classes.root}>
{/*...*/}
</div>
)
@robcmills
robcmills / catan-conquest.md
Last active March 17, 2016 06:54
Conquest of Catan. Build, attack, conquer.

Catan Conquest

The objective of Catan Conquest is to grow your army, claim the most land, defeat your enemies, and conquer the island of Catan.

Overview of changes:

  • resource production refactor (see Resources section below)
  • settlements, cities, & armies are placed in the center of hexes instead of at the intersections
@robcmills
robcmills / catan-castles-and-armies.md
Last active March 15, 2016 16:11
Catan Castles & Armies

Catan Castles & Armies

Unless noted here, Catan Castles & Armies follows all the rules of regular Catan

Overview of changes:

  • buildings (settlements, cities, armies) are placed in the center of hexes instead of at the intersections
  • no distance rule (except for initial placement)
@robcmills
robcmills / colorful-git
Created January 14, 2016 22:44
colorful git
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@robcmills
robcmills / trim-html.js
Last active December 16, 2015 17:44
Simple function to trim html content to a specified length.
// var htmlIn = '<div>Hello world!</div>';
// var htmlIn = '<div>Hello <b><i>world!</i></b></div>';
// var htmlIn = '<div><ol><li>Hello</li><li><b>world!</b></li></ol></div>';
// var htmlIn = '<div>1</div><div>2</div><div><br/></div><ol><li><b><i>Hello<i><b></li><li><b>world!</b></li></ol></div>';
var htmlIn = '<div>Hello </div><div><br/></div><div>world!</div>';
var trimTo = 8; // trim to this length
var trimHtml = function(html, trim) {
@robcmills
robcmills / camera-submit-codepath.js
Created September 9, 2015 01:49
selected code from codepath following bonus cam media submission to retry upload
// file input element gets media
// submission_media.hbs line:36
<form enctype="multipart/form-data" class='media-upload-form'>
// submission_media.js line:134
fileDidChange: function() {
//...
this.setFile(file);