This file contains 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 Modal from "components/Modal" | |
import styled, { css } from "styled-components" | |
import { Button } from "components" | |
import PropTypes from "prop-types" | |
const MessageContainer = styled.div` | |
display: flex; | |
align-items: center; | |
justify-content: center; |
This file contains 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 useSetUp({ initialSearch = "", initialResult = [] }) { | |
const [search, setSearch] = React.useState(initialSearch); | |
const [result, setResult] = React.useState(initialResult); | |
return { | |
search, | |
setSearch, | |
result, | |
setResult, | |
}; |
This file contains 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 SearchAndResultView({ search, setSearch, result }) { | |
return ( | |
<Modal> | |
<SearchBox search={search} setSearch={setSearch} /> | |
<ResultContainer result={result} /> | |
</Modal> | |
); | |
} | |
function AnyofyourComponent() { |
This file contains 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
formatRFC3339 | |
const ( | |
ANSIC = "Mon Jan _2 15:04:05 2006" | |
UnixDate = "Mon Jan _2 15:04:05 MST 2006" | |
RubyDate = "Mon Jan 02 15:04:05 -0700 2006" | |
RFC822 = "02 Jan 06 15:04 MST" | |
RFC822Z = "02 Jan 06 15:04 -0700" // RFC822 with numeric zone | |
RFC850 = "Monday, 02-Jan-06 15:04:05 MST" | |
RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST" |
This file contains 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 const parseTextAndATag = string => { | |
if (!string) return null; | |
const HtmlParser = new DOMParser(); | |
const parsedDocument = HtmlParser.parseFromString(string, 'text/html'); | |
const childNodes = parsedDocument.body.childNodes; | |
const arrHtmlNodes = [].slice.call(childNodes); | |
const finalHTMLString = arrHtmlNodes.reduce((acc, elem) => { | |
const isText = elem.nodeType === 3; |
This file contains 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
1) Create a branch with the tag | |
git branch {tagname}-branch {tagname} | |
git checkout {tagname}-branch | |
2) Include the fix manually if it's just a change .... | |
git add . | |
git ci -m "Fix included" | |
or cherry-pick the commit, whatever is easier | |
git cherry-pick {num_commit} | |
They're just variables you set on your system that various programs/processes can read. A fairly standard example in javascript circles would be setting your NODE_ENV
variable to "production" or "development", altering how node code is executed on your system (for example showing more debug messaging when in development).
With most shells there's a way to set them for the current session, and a way to set them for all sessions. The following is meant to be a guide on how to set env vars in the various shells.
Setting for the session: