The mongo airbnb sample database
Import it into your local mongo with:
mongoimport -h localhost:27017 --db sample_airbnb --collection listingsAndReviews --file listingsAndReviews.json
The mongo airbnb sample database
Import it into your local mongo with:
mongoimport -h localhost:27017 --db sample_airbnb --collection listingsAndReviews --file listingsAndReviews.json
import json | |
import os | |
import time | |
import webbrowser | |
import sys | |
import re | |
def handleWindows(extra_seconds): | |
print("OS : Windows") |
import Container from "components/ui/Container" | |
import VideoCard from "components/VideoCard" | |
import fetchData from "helpers/fetchData" | |
import { useEffect, useState, Fragment, useRef } from "react" | |
import { useInfiniteQuery } from "react-query" | |
import useIntersectionObserver from "../hooks/useIntersectionObserver" | |
import Select from "react-select" | |
import { useUIDSeed } from "react-uid" | |
import { useRouter } from "next/router" | |
import Seo from "components/Seo" |
Since Chrome apps are now being deprecated. Download postman from https://dl.pstmn.io/download/latest/linux
Although I highly recommend using a snap
sudo snap install postman
tar -xzf Postman-linux-x64-5.3.2.tar.gz
import { object, string, number, ValidationError } from '@hapi/joi'; | |
const schema = object({ | |
searchCode: string() | |
.required() | |
.label('Search code'), | |
id: number().required() | |
}), | |
messages = { | |
'alternatives.all': '{{#label}} does not match all of the required types', |
Thanks to /u/zpoo32 for reporting several issues in this list!
// React doesn't use es2015 "export default react" syntax in their NPM dist. | |
// Instead they set a "default" key in their export object. | |
/** node_modules/react/cjs/react.development.js | |
... | |
var React$2 = Object.freeze({ | |
default: React | |
}); |
import ReactDOMServer from 'react-dom/server'; | |
export function encodeSvg(reactElement) { | |
return 'data:image/svg+xml,' + escape(ReactDOMServer.renderToStaticMarkup((reactElement))); | |
} |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.