Skip to content

Instantly share code, notes, and snippets.

View nchlswhttkr's full-sized avatar
:shipit:
I ship it

Nicholas Whittaker nchlswhttkr

:shipit:
I ship it
View GitHub Profile
const express = require('express');
const app = express();
// Application
app.get('/', function(req, res) {
if (process.env.NODE_ENV === 'development') {
for (var key in require.cache) {
delete require.cache[key];
}
}
@auzwang
auzwang / Localz Driver Tracker Challenge.md
Last active December 13, 2019 06:21
Localz Driver Tracker Challenge

Localz Driver Tracker

Localz is building a platform to track driver locations as they deliver parcels.

A driver logs into their device and begins submitting location. This location will be used for the customer to track the driver on a map.

Requirements

Please conform to the requirements below, we do not expect you to go beyond these. This is a server-side challenge.

@bessarabov
bessarabov / gist:674ea13c77fc8128f24b5e3f53b7f094
Last active March 27, 2024 07:46
One-liner to generate data shown in post 'At what time of day does famous programmers work?' — https://ivan.bessarabov.com/blog/famous-programmers-work-time
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }'
@bvaughn
bvaughn / index.md
Last active May 4, 2024 11:25
How to use profiling in production mode for react-dom

React recently introduced an experimental profiler API. This page gives instructions on how to use this API in a production release of your app.

Table of Contents

Profiling in production

React DOM automatically supports profiling in development mode for v16.5+, but since profiling adds some small additional overhead it is opt-in for production mode. This gist explains how to opt-in.

@bvaughn
bvaughn / index.md
Last active April 3, 2024 07:41
Interaction tracing with React

This API was removed in React 17


Interaction tracing with React

React recently introduced an experimental profiler API. After discussing this API with several teams at Facebook, one common piece of feedback was that the performance information would be more useful if it could be associated with the events that caused the application to render (e.g. button click, XHR response). Tracing these events (or "interactions") would enable more powerful tooling to be built around the timing information, capable of answering questions like "What caused this really slow commit?" or "How long does it typically take for this interaction to update the DOM?".

With version 16.4.3, React added experimental support for this tracing by way of a new NPM package, scheduler. However the public API for this package is not yet finalized and will likely change with upcoming minor releases, so it should be used with caution.

//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
@Noxville
Noxville / 3958810354.log (open qualifiers 'CY6IXXCY6IXX')
Last active June 23, 2018 00:48
Various activations and deactivations of Atun's Armlet.
[00:25:11.086] npc_dota_hero_legion_commander uses item_armlet
[00:25:20.117] npc_dota_hero_legion_commander uses item_armlet
[00:25:25.449] npc_dota_hero_legion_commander uses item_armlet
[00:25:32.414] npc_dota_hero_legion_commander uses item_armlet
[00:25:37.246] npc_dota_hero_legion_commander uses item_armlet
[00:25:42.978] npc_dota_hero_legion_commander uses item_armlet
[00:25:51.842] npc_dota_hero_legion_commander uses item_armlet
[00:25:55.675] npc_dota_hero_legion_commander uses item_armlet
[00:26:04.139] npc_dota_hero_legion_commander uses item_armlet
[00:26:11.237] npc_dota_hero_legion_commander uses item_armlet
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@fzaninotto
fzaninotto / material-ui-10-migration-feedback.md
Created November 8, 2017 21:10
Feedback from migrating a material-ui app to 1.0

I have migrated about 11 kloc from material-ui 0.X to material ui 1.0 (a moderate size project). It has taken me more than 20 hours, and it was not a pleasant experience. cf https://github.com/marmelab/admin-on-rest/pull/1167

No Migration Path

I understand that you took the opportunity of a major BC break to rethink the API completely. But coming from 0.X, the changes often aren't consistent. Each component has changed in a different way, and for a given component, there is no way to guess the 1.0 API based on the 0.x API. Why did <ToolbarGroup> disappear? Why do I need to decompose a ListItem into so many sub components now? Why was Toggle renamed to Switch?

@muhammadghazali
muhammadghazali / What is server_names_hash_bucket_size.md
Last active February 9, 2024 14:13
Nginx: What is server_names_hash_bucket_size?

Background

While I'm learning how to use Nginx, I was instructed to update the server_names_hash_bucket_size (/etc/nginx/nginx.conf) value from 32 to 64, but I don't understand why should I increase the value to 64.

References

References that have been read so far: