Skip to content

Instantly share code, notes, and snippets.

View fed's full-sized avatar

fed

View GitHub Profile
@fed
fed / a11y-checklist.md
Created July 7, 2020 01:57
Accessibility Checklist by HEY

First principles

  • It should be easy to get around. We offer keyboard-based shortcuts to navigate throughout HEY and structure the app’s layout with function in mind.
  • We design with legibility at the forefront. HEY uses easy-to-read fonts and we prioritize high contrast in our designs.
  • Accessibility is a constant requirement. We’re never “done” working on the accessibility of HEY.

Current accessibility review process

At Basecamp, our Accessibility Lead is also our Quality Assurance Lead, Michael Berger. Michael works with a team at Aspiritech to to test every new feature and workflow before it is shipped. Michael has also developed — and continues to maintain — an internal Accessibility Handbook as a resource for designers.

@fed
fed / jira-template.md
Created April 15, 2020 01:09
JIRA Ticket Template

Issue / Request

Client context

Priority context

Affected versions

Acceptance criteria

@fed
fed / README.md
Last active October 11, 2019 11:06
CSS Specificity

CSS Specificity

When multiple selectors are targeting the same element, the browser needs to know which one to apply. This is where the cascading aspect of CSS and specificity come into play. It's important to understand how specificity is calculated, so that you'll be able to figure out which style will actually end being applied in the browser.

(
  inline styles,
  IDs,
  classes | attributes | pseudo-classes,
  elements | pseudo-elements
@fed
fed / README.md
Created September 3, 2019 09:00
Focus Debugging Snippet

Debugging Snippet

This snippet is useful for debugging things like who's setting focus on a particular element.

DevTools > Source tab > Top left panel > Select snippet > New snippet

Disclaimer: this snippet only breaks when <HTMLElement>.focus() is called -- if you want to break on focus events, Safari's debugger lets you set DOM event breakpoints.

@fed
fed / bubble-sort.js
Created August 31, 2017 22:17
Bubble Sort
const numbers = [13, 5, -3, 7, 6, 4, 1, 17, 0, -1, -2];
function sort(arr) {
const sorted = arr.slice();
let swapped;
do {
swapped = false;
for (let i = 0, l = sorted.length; i < l; i++) {
@fed
fed / factorial.js
Created August 31, 2017 20:46
Factorial
// Recursively
// From `n`, all the way down to 1
function factorial(n) {
if (n < 2) {
return 1;
}
return n * factorial(n - 1);
}
@fed
fed / linked-list.js
Last active August 22, 2017 18:48
Singly-linked lists implementation
function Node(data) {
this.data = data;
this.next = null
}
function LinkedList() {
this.head = null;
this.length = 0;
}
@fed
fed / observer.js
Created August 22, 2017 17:44
Simple observer pattern implementation
function Counter() {
this.count = 0;
this.observers = [];
}
Counter.prototype.increment = function () {
this.count++;
this.notify({ count: this.count });
};
@fed
fed / fibonacci.js
Last active August 22, 2017 17:21
Fibonacci with Memoization
// Time complexity: O(n)
// Space complexity: O(n)
const memo = new Map();
function fibonacci(n) {
if (memo.has(n)) {
return memo.get(n);
}
@fed
fed / ssr.js
Last active August 31, 2017 20:23
Isomorphic JavaScript Server Logic Example
/*
* Rendering our component server side
*/
var React = require('react');
var App = require('../lib/components/todo-item');
var data = { title: 'Hello world!' };
var renderedComponent = ReactDOMServer.renderToString(<App data={data} />);