Skip to content

Instantly share code, notes, and snippets.

View NSLog0's full-sized avatar
🦋

NSLog0 NSLog0

🦋
View GitHub Profile
from sshtunnel import SSHTunnelForwarder
import pymongo
EC2 = "<IP>"
MONGO_DB = "test_database"
MONGO_COLLECTION = "post"
# define ssh tunnel
server = SSHTunnelForwarder(
EC2,
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
const priceValidator = ({
products = [],
tax = 0,
deliveryFee = 0,
limitDeliveryFee = 0,
pointToDiscount = 0,
pointToDiscountRate = 10
}: IPriceValidator) => {
const PRICE_OFFSET = 100
@NSLog0
NSLog0 / python.38.Dockerfile
Created October 25, 2020 14:01
Dockerfile for python 3.8 image fork
#
# 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.
@NSLog0
NSLog0 / dna1.ipynb
Last active April 28, 2020 19:44
DNA Analysis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@NSLog0
NSLog0 / rest-ex.md
Last active February 1, 2020 17:28

| 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|

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,
);
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,
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(