| Resource |GET (Read) | POST (Create) | PUT (Bulk update) |PATCH (Update)| |DELETE (Delete)| |---|---|---|---|---|---| |/books| Return a list of books| Creates a new book|Bulk update|Delete all| |books/2|Return a sprecific book| Method not allowed (HTTP 405)| Updates a specific user| Deletes a specific user|
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
from sshtunnel import SSHTunnelForwarder | |
import pymongo | |
EC2 = "<IP>" | |
MONGO_DB = "test_database" | |
MONGO_COLLECTION = "post" | |
# define ssh tunnel | |
server = SSHTunnelForwarder( | |
EC2, |
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
class INotification | |
def send | |
raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" | |
end | |
def body | |
raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" | |
end | |
end |
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
const priceValidator = ({ | |
products = [], | |
tax = 0, | |
deliveryFee = 0, | |
limitDeliveryFee = 0, | |
pointToDiscount = 0, | |
pointToDiscountRate = 10 | |
}: IPriceValidator) => { | |
const PRICE_OFFSET = 100 |
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
# | |
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" | |
# | |
# PLEASE DO NOT EDIT IT DIRECTLY. | |
# | |
FROM buildpack-deps:buster | |
# ensure local python is preferred over distribution python | |
ENV PATH /usr/local/bin:$PATH |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 * as R from 'ramda' | |
const EN_MESSAGE = 'Our website is under renovate, please be patient. We\'ll be back soon' | |
const TH_MESSAGE = 'กำลังปรับปรุงเว็บใหม่' | |
const lang = 'en' | |
const showMessage = R.ifElse( | |
R.propEq('lang', 'en'), | |
() => EN_MESSAGE, | |
() => TH_MESSAGE, | |
); |
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 PropTypes from 'prop-types' | |
import { get, mapKeys, snakeCase, omitBy } from 'lodash' | |
import className from 'classnames' | |
import { connect } from 'react-redux' | |
import moment from 'moment' | |
import { | |
getProject, | |
loadProject, |
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 argparse | |
import io | |
import time | |
import numpy as np | |
from edgetpu.detection.engine import DetectionEngine | |
import cv2 | |
def main(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument( |
NewerOlder