Skip to content

Instantly share code, notes, and snippets.

View jaydenseric's full-sized avatar
🇦🇺
Deno, Node.js, GraphQL & React

Jayden Seric jaydenseric

🇦🇺
Deno, Node.js, GraphQL & React
View GitHub Profile
export function loadConfigModule(filename) {
// sub your own
return require(filename);
}
/**
* Modify a Webpack configuration by applying a mutator module/function.
* @param {Object} options
* @param {Object} options.config Webpack configuration object to modify in-place
import ReactDOM from "react-dom";
export default ReactDOM.unstable_batchedUpdates;
@fnky
fnky / ANSI.md
Last active May 3, 2024 00:12
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@GeoffreyBooth
GeoffreyBooth / npm-packages-module-field-analysis.md
Last active November 22, 2018 11:16
Analysis of public NPM packages using the “module” field

I did some research into the package.json "module" field. I wrote some code to download all the the package.json files from all the public packages in the NPM registry. Here are some findings:

941 public NPM packages use the "module" field as of 2018-10-22.

Here are the top 30 packages, as ranked by number of public dependents (or see the full list):

Dependents Package Name "module" Field Value
16,286 should ./es6/should.js
15,472 sinon ./pkg/sinon-esm.js
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@jkrems
jkrems / es-module-history.md
Last active November 5, 2023 19:35
History of ES modules

Modules - History & Future

History

@cthurston
cthurston / mongodb-facet-combine.js
Created November 3, 2017 14:21
MongoDb combine $facet results into a single result set.
db.getCollection('list').aggregate([
{
$facet: {
"events":[{
$match: {
'type': 'Event'
}
}],
"tasks": [{
$match: {
@helfer
helfer / apollo-1-migration.md
Last active May 31, 2017 01:09
Migrating from Apollo Client 0.x to 1.0

Migrating from Apollo Client 0.x to 1.0

Here are the main breaking changes between the 0.x and 1.0 versions of Apollo Client.

fetchMore

The structure of fetchMoreResult has been changed. Previously fetchMoreResult used to contain data and loading fields, now fetchMoreResult is what fetchMoreResult.data used to be. This means your updateQueries function has to change as follows:

updateQuery: (prev, { fetchMoreResult }) => {
@umidjons
umidjons / authenticate-nodejs-api-with-jsonwebtoken.md
Last active August 10, 2018 11:48
Authenticate a Node.js API with JSON Web Tokens