Skip to content

Instantly share code, notes, and snippets.

Carl Vitullo vcarl

  • Interstellar
  • New York
Block or report user

Report or block vcarl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vcarl
vcarl / userTimingMiddleware.js
Last active Jul 5, 2019 — forked from clarkbw/redux-performance-mark.js
A User Timing middleware for redux to create performance markers for dispatched actions
View userTimingMiddleware.js
const userTiming = () => (next) => (action) => {
if (performance.mark === undefined) return next(action);
performance.mark(`${action.type}_start`);
const result = next(action);
performance.mark(`${action.type}_end`);
performance.measure(
`${action.type}`,
`${action.type}_start`,
`${action.type}_end`,
);
View keybase.md

Keybase proof

I hereby claim:

  • I am vcarl on github.
  • I am vcarl (https://keybase.io/vcarl) on keybase.
  • I have a public key ASDlWlpXqRlQBdfwuc6TB0DKpDQdXtlKgT97d7lQCv_v8wo

To claim this, I am signing this object:

View questions-for-your-interviewer.md

I bundled these up into groups and wrote some thoughts about why I ask them!

If these helped you, I'd love to hear about it!! I'm on twitter @vcarl_ or send me an email carl.vitullo@gmail.com

Onboarding and the workplace

https://blog.vcarl.com/interview-questions-onboarding-workplace/

  • How long will it take to deploy my first change? To become productive? To understand the codebase?
  • What kind of equipment will I be provided? Will the company pay/reimburse me if I want something specific?
View 1foreward-and-intro.md

“Honesty in small things is not a small thing.”

This is a book about humble concerns whose value is nonetheless far from small.

We can accept for granted that responsible professionals give some time to thinking and planning at the outset of a project.

I think this is one of the base assumptions the book makes about its readers. If your routine is to hop directly into code without a thought for the overall design, you may try to change that habit.

Total Productive Maintenance

View gist:76ca26f5c40b3ecfc5e4e22aec81bbd4
const ToHoc = (Component) => {
return (Wrapped) => {
class GeneratedHOC extends React.Component {
render() {
return (
<Component render={args => <Wrapped {...this.props} {...args} /> } />
);
}
}
}
View managing.md

Adding manpower to a late software project makes it later.

Development managers often win their management roles primarily from having been stellar coders while displaying a modicum of people skills.

Programming teams can tell management that the product is one week from being functionally complete every week for the months.

A program can produce the desired results and be so poorly designed and/or executed that it cannot realistically be enhanced or maintained.

For too many managers (especially less technical managers, such as CEOs or CFOs) prototypes appear to be “done.”

@vcarl
vcarl / router.js
Created Sep 14, 2016
Synchronous routing example
View router.js
import Restify from 'restify';
import SyncRoute from './sync-route';
const server = Restify.createServer({
name: 'SyncRoutingDemo'
});
server.use(Restify.bodyParser());
SyncRoute(server, {
verb: 'post',
@vcarl
vcarl / package.json
Last active Oct 27, 2016
Sample webpack 2 config
View package.json
{
"name": "jstest",
"version": "1.0.0",
"description": "",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
View visible-hoc.cjsx
define (require) ->
_ = require('lodash')
React = require('react')
ReactDOM = require('react-dom')
# Modified from http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport
isElementInViewport = (el) ->
rect = el.getBoundingClientRect();
(
@vcarl
vcarl / text.md
Last active Dec 14, 2015
How to learn React
View text.md

Read "Smart and Dumb Components" by Dan Abramov (who later wrote Redux, a hugely popular variation on Facebook's Flux architecture).

https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0#.mo7f1h57v

In general, you need to make more components than you think you do. Facebook has over 15,000. Not only is more components not harmful to performance, by giving a lot of split points and more narrowly defining what data is needed to render, you can reduce how much DOM gets invalidated--which is a massive performance gain.

As of React 0.14.0, React supports stateless function components which are functions that take a props object as an argument and return as a render function. They have caveats though, like no lifecycle, state, or refs. So why use them? Because they encourage writing small, focused components t

You can’t perform that action at this time.