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
| /** | |
| * input: lat, lng | |
| * output: map from gmaps | |
| * @param {Float} lat | |
| * @param {Float} lng | |
| */ | |
| export const getMap = (lat, lng) => | |
| `https://maps.googleapis.com/maps/api/staticmap?center=${lat},${lng}&zoom=14&size=350x350&markers=color:blue|${lat},${lng}&key=${ | |
| window.modern_tribe_config.cafe_locator.api_key | |
| }` |
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
| /** | |
| * input: object | undefined | null | |
| * output: if object is empty returns true | |
| * @param {object} obj | |
| */ | |
| export const isEmpty = obj => obj && !Object.getOwnPropertyNames(obj).length |
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 from "react" | |
| import { ThemeProvider } from "emotion-theming" | |
| import { theme, LsMuiThemeProvider } from "./index" | |
| const withThemeHOC = <P extends object>(Component: React.ComponentType<P>) => | |
| class withThemeComponent extends React.Component<P & any> { | |
| render() { | |
| return ( | |
| <LsMuiThemeProvider> | |
| <ThemeProvider theme={theme}> | |
| <Component {...this.props as P} /> |
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
| // Switch case | |
| switch (measureErrorTypeSelected) { | |
| case ERROR_MARGIN: | |
| return ( | |
| selectedErrorColumnIndex.length > 0 && !!measureErrorLevelSelected | |
| ) | |
| case CONFIDENCE_INTERVAL: | |
| return ( | |
| selectedErrorColumnIndex.length === 2 && | |
| !!measureErrorLevelSelected && |
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
| // o(n)^2 | |
| var numJewelsInStones = function(J, S) { | |
| let myJewels = 0; | |
| // Jewels | |
| for (var i = 0; i < J.length; i++) { | |
| // Stones | |
| for (var j = 0; j < S.length; j++) { // Nested! | |
| if (J[i] === S[j]) { | |
| myJewels++; | |
| } |
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
| echo "set completion-ignore-case On" >> ~/.inputrc |
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 URL = 'http://swapi.co/api/people/1'; | |
| fetch(URL) | |
| .then((data) => data.json()) | |
| .then((json) => { | |
| this.setState(json); | |
| }); |
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 filtradas = formattedLocations.filter( | |
| f => | |
| f.description !== "Custom Locale" && | |
| !f.description.includes("New Custom Location") && | |
| !f.description.includes("New custom locale") && | |
| !f.description.includes("test") && | |
| !f.description.includes("force") && | |
| !f.description.includes("my") && | |
| f.description !== "accept-any" && | |
| f.description !== "Add new custom location..." && |