This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * For demonstration purposes only. Normally this promise would | |
| * do something cool, like fetch data from a remote API. | |
| * | |
| * @param entity | |
| * @returns {Promise} | |
| */ | |
| function fakePromise() { | |
| return new Promise(resolve => { | |
| const delay = _getShortDelay(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const isEmpty = value => value === undefined || value === null || value === ''; | |
| const join = (rules) => (value, data) => rules.map(rule => rule(value, data)).filter(error => !!error)[0 /* first error */ ]; | |
| export function email(value) { | |
| // Let's not start a debate on email regex. This is just for an example app! | |
| if (!isEmpty(value) && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(value)) { | |
| return 'Invalid email address'; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This example would cause an error by ESLint because we are using ES6 JS (it would suggest `const` or `let`) | |
| … | |
| /* eslint-disable */ | |
| var x = 1; | |
| … | |
| /* eslint-enable */ | |
| … | |
| var y = 2; // throws eslint-error suggestioning to use `const` or `let` | |
| … |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { PropTypes } from 'react'; | |
| import { Provider } from 'react-redux'; // Or something else, if you're not using Redux | |
| import Router from 'react-router/lib/Router'; | |
| const Root = ({ store, history, routes }) => ( | |
| <Provider store={store} key="provider"> | |
| <Router history={history} routes={routes} /> | |
| </Provider> | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="root"> | |
| <style type="text/css" scoped> | |
| h1 { z-index: 10; font-family: 'Roboto', 'Helvetica', sans-serif; display: inline-block; } | |
| .loader { | |
| margin: 10% auto; | |
| font-size: 10px; | |
| position: relative; | |
| text-indent: -9999em; | |
| border-top: 1.1em solid rgba(100, 100, 100, 0.2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==== Ligature fonts for atom | |
| // JM 12/14/2016 | |
| // Sources: | |
| // - https://github.com/tonsky/FiraCode | |
| // - http://www.dafont.com/flottflott.font | |
| // | |
| // Reference (original): https://medium.com/@docodemore/an-alternative-to-operator-mono-font-6e5d040e1c7e#.nm9fchwv1 | |
| // Reference (improved): https://gist.github.com/MattMcFarland/e41ef709b1d82adea800563a86805559#gistcomment-1835618 | |
| @fontsize: 16px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //------------------------ | |
| // General/Matchmaking Settings (begin) | |
| //------------------------ | |
| mm_dedicated_search_maxping “70″ | |
| cl_autowepswitch "0" | |
| cl_loadout_colorweaponnames "1" | |
| cl_mute_enemy_team "1" | |
| cl_bob_lower_amt 0 | |
| cl_bobamt_lat 0 | |
| cl_bobamt_vert 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export NVM_DIR=~/.nvm | |
| source ~/.nvm/nvm.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function anagram(wordOne, wordTwo) { | |
| var isAnagram = false; | |
| if (wordOne.split('').length === wordTwo.split('').length) { | |
| wordOne.split('').sort().every(function(one, two) { | |
| return isAnagram = one === wordTwo.split('').sort()[two]; | |
| }); | |
| } | |
| return isAnagram; | |
| } | |
| console.log(anagram("jordan", "najorad")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // `File > Preferences > User Settings`(WINDOWS) | |
| // Place your settings in this file to overwrite the default settings | |
| { | |
| "editor.fontSize": 14, | |
| "editor.fontFamily": "'Fira Code', Consolas, 'Courier New', monospace", | |
| "editor.fontLigatures": true, | |
| "editor.fontWeight": "normal", | |
| "editor.tabSize": 2, | |
| "editor.formatOnSave": true, |