View package.json
{
"name": "sample-nodemon",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"nodemon": "^1.14.11",
"pack-with-jsbn": "../pack-with-jsbn"
}
}
View package.json
{
"name": "sample-nodemon",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"pack-with-jsbn": "../pack-with-jsbn"
}
}
View package.json
{
"name": "pack-with-jsbn",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"jsbn": "^1.1.0"
}
}
View LasyImage.jsx
class LazyImage extends PureComponent {
static defaultProps = {
engage: false,
};
state = {
initialEngage: false,
};
componentWillMount() {
View workbox.config.js
const fs = require('fs');
const path = require('path');
const loadJsonFile = require('load-json-file');
const dotNext = path.resolve(__dirname, '.next');
const stats = loadJsonFile.sync(`${dotNext}/build-stats.json`);
const buildId = fs.readFileSync(`${dotNext}/BUILD_ID`, 'utf8');
View operator_with_ligatures.md

Using Operator Mono with Fira Code ligatures in Atom.

  1. Open your Atom's Stylesheet
    image

  2. Put this css

atom-text-editor {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
View get_nested.js
// https://medium.com/javascript-inside/safely-accessing-deeply-nested-values-in-javascript-99bf72a0855a
const idx = p => o =>
p.reduce((xs, x) =>
(xs && xs[x]) ? xs[x] : null, o)
const getUserComments = idx(['posts', 0, 'comments'])
const user = {}
console.log(getUserComments(user))
View sw-test-cleaup.js
window.__testCleanup = () => {
const unregisterSW = () => {
return navigator.serviceWorker.getRegistrations()
.then((registrations) => {
const unregisterPromise = registrations.map((registration) => {
return registration.unregister();
});
return Promise.all(unregisterPromise);
});
};
View my-first-test.js
describe('Service Worker Suite', function() {
beforeEach(function() {
return navigator.serviceWorker.getRegistrations()
.then((registrations) => {
const unregisterPromises = registrations.map((registration) => {
return registration.unregister();
});
return Promise.all(unregisterPromises);
});
View ServerProvider.jsx
import React from 'react';
/**
* Server only Provider component that passes promises as context
*/
export default class ServerFetchProvider extends React.Component {
static childContextTypes = {
serverFetchPromises: React.PropTypes.array
};
static propTypes = {