A fork of the popular open-source contract for web designers and developers by Stuff & Nonsense, reworded for developers
- Originally published: 05/02/2014
- Original post
Between us [company name] and you [customer name]
Between us [company name] and you [customer name]
Note: these are pretty rough notes I made for my team on the fly as I was reading through some pages. Some could be mildly inaccurate but hopefully not terribly so. I might resort to convenient fiction & simplification sometimes.
My top contenders, mostly based on popularity / community etc:
Mostly about MVC (or derivatives, MVP / MVVM).
var peek = module.exports = function (fn) { | |
var peeked = false; | |
return through(function write(data) { | |
this.emit('data', data); | |
if (peeked) { | |
return; | |
} | |
peeked = true; | |
var stream = this; | |
var cont = function (end) { |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
d3.sankey = function() { | |
var sankey = {}, | |
nodeWidth = 24, | |
nodePadding = 8, | |
size = [1, 1], | |
nodes = [], | |
links = []; | |
sankey.nodeWidth = function(_) { | |
if (!arguments.length) return nodeWidth; |
import produce from 'immer'; | |
import {createStore} from 'redux'; | |
const handleActions = (actionsMap, defaultState) => ( | |
state = defaultState, | |
{type, payload} | |
) => | |
produce(state, draft => { | |
const action = actionsMap[type]; | |
action && action(draft, payload); |
We've been building a hooks based REST API wrapper.
A specific use case discussed in this gist is – how do you close a modal after updating a remote resource completes succesfully?
Which of the following options seems best or is there a better approach altogether?
function EditNoteModal ({ id, onClose }) {
There's the pervarsive notion that all JS is created equal and that there's only minor and easily detectable differences between the various file formats used to author JavaScript. This is correct, from a certain point of view.
For many people writing JavaScript that gets passed into build tools,
// ---------- | |
// Cancel function! | |
// ---------- | |
// NOTE: | |
// This allows us to externalize the cancel function.. | |
// kind of like a inversion of control | |
let expensiveApplication = delayMs => new Promise(resolve => setTimeout(resolve, delayMs)) | |
// Long Running Process - LRP with cancel function! |