I hereby claim:
- I am devinclark on github.
- I am dddev (https://keybase.io/dddev) on keybase.
- I have a public key ASBskmZ3qM25Ebyknx2SPjI1KvjP9sS229__NQpZ79i4Awo
To claim this, I am signing this object:
| /** | |
| * A fuzzy match algorithm. | |
| * @param {string} needle the string to search for | |
| * @param {string} haystack the string to search in | |
| */ | |
| export function fuzzyMatch(needle: string = "", haystack: string = "") { | |
| const haystackLen = haystack.length; | |
| const needleLength = needle.length; | |
| needle = needle.toLowerCase(); |
| function isAnyPartOfElementInViewport(el) { | |
| const rect = el.getBoundingClientRect(); | |
| const windowHeight = (window.innerHeight || document.documentElement.clientHeight); | |
| const windowWidth = (window.innerWidth || document.documentElement.clientWidth); | |
| const vertInView = (rect.top <= windowHeight) && ((rect.top + rect.height) >= 0); | |
| const horInView = (rect.left <= windowWidth) && ((rect.left + rect.width) >= 0); | |
| return (vertInView && horInView); | |
| } |
I hereby claim:
To claim this, I am signing this object:
| const { deepStrictEqual } = require('assert'); | |
| const fs = require('fs'); | |
| const ADDITION = 1; | |
| const MULTIPLCATION = 2; | |
| const EOF = 99; | |
| const DEBUG = false; | |
| function executeProgram(input) { | |
| const program = input.split(',').map((v) => parseInt(v)); |
| const fs = require('fs'); | |
| const getLatestVersion = require('latest-semver'); | |
| const semver = require('semver'); | |
| require('isomorphic-fetch'); | |
| const NPM = 'https://registry.npmjs.com'; | |
| function getPackage(name) { | |
| return fetch(`${NPM}/${name}`) | |
| .then(function (response) { |
It takes the modules that are common between X number of your entry points and puts them in a "common.js" file.
So if I have 3 entry points (one for each page of my application) and they all require React, the common.js file will have react in it. I can cache this file longer than the pageX.js files and my pageX.js bundles will be smaller because they don't have React.
| var glob_entries = require('webpack-glob-entries'); | |
| var webpack = require('webpack'); | |
| var validate = require('webpack-validator'); | |
| var env = process.env.NODE_ENV || 'development'; | |
| var entries = glob_entries('./src/js/component/page/*.js'); | |
| var LodashModuleReplacementPlugin = require('lodash-webpack-plugin'); | |
| var webpackConfig = { | |
| // create multiple entry points from all of the page level components |
| [btsync] | |
| title=BitTorrent Sync | |
| description=Fast, private file sharing for teams and individuals. | |
| ports=3000/tcp|1900/udp|58610/udp|3838/udp|19717/tcp|50443/udp |
| $stateProvider | |
| .state({ | |
| name: 'root', | |
| url: '', | |
| abstract: true, | |
| templateUrl: '/templates/root.html', | |
| controller: 'MainController', | |
| controllerAs: 'Main', | |
| resolve: { | |
| token: function ($q, Auth) { |