Skip to content

Instantly share code, notes, and snippets.

View crapthings's full-sized avatar
😎
🇰🇵我们晚上去

crapthings crapthings

😎
🇰🇵我们晚上去
View GitHub Profile

基础

查看所有三元组

SELECT * WHERE {
  ?subject ?predict ?object .
}

'?' 代表 变量

@crapthings
crapthings / gist:9654f57baade63f3ec200a0ab7358073
Created August 14, 2018 02:16
How do I change the Docker image installation directory
https://forums.docker.com/t/how-do-i-change-the-docker-image-installation-directory/1169
@crapthings
crapthings / gist:d60536b69357e2108ce93144338f8d30
Created October 16, 2018 06:28
法律相关词条 hanlp
中华人民共和国专利法 nz 1000
中华人民共和国专属经济区和大陆架法 nz 1000
中华人民共和国个人所得税法 nz 1000
中华人民共和国个人独资企业法 nz 1000
中华人民共和国中国人民银行法 nz 1000
中华人民共和国中外合作经营企业法 nz 1000
中华人民共和国中外合资经营企业所得税法 nz 1000
中华人民共和国中外合资经营企业法 nz 1000
中华人民共和国中小企业促进法 nz 1000
中华人民共和国义务教育法 nz 1000
决议
决定
命令(令)
公报
公告
通告
意见
通知
通报
报告
import cv2
import numpy as np
def rectify(h, l):
h = h.reshape((l, 2))
hnew = np.zeros((4, 2), dtype = np.float32)
add = h.sum(1)
hnew[0] = h[np.argmin(add)]
hnew[2] = h[np.argmax(add)]
diff = np.diff(h, axis = 1)
import cv2
import numpy as np
def rectify(h, l):
h = h.reshape((l, 2))
hnew = np.zeros((4, 2), dtype = np.float32)
add = h.sum(1)
hnew[0] = h[np.argmin(add)]
hnew[2] = h[np.argmax(add)]
diff = np.diff(h, axis = 1)
@crapthings
crapthings / a-mongodb-replica-set-docker-compose-readme.md
Created July 5, 2019 01:28 — forked from harveyconnor/a-mongodb-replica-set-docker-compose-readme.md
MongoDB Replica Set / docker-compose / mongoose transaction with persistent volume

This will guide you through setting up a replica set in a docker environment using.

  • Docker Compose
  • MongoDB Replica Sets
  • Mongoose
  • Mongoose Transactions

Thanks to https://gist.github.com/asoorm for helping with their docker-compose file!

wait && mongo --host mongo1 --port 27017 --eval "rs.initiate({ _id: 'rs0', members: [{ _id: 0, host: 'mongo1:27017' }, { _id: 1, host: 'mongo2:27017' }, { _id: 2, host: 'mongo3:27017' } ] })"
const parser = str => {
let ops = []
let method, arg
let isMethod = true
let open = []
for (const char of str) {
// skip whitespace
if (char === ' ') continue
const nodersa = require('node-rsa')
const axios = require('axios')
const express = require('express')

const server = express()

const PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----YOUR KEY HERE-----END PRIVATE KEY-----"
const key = new nodersa(PRIVATE_KEY, 'pkcs8-private-pem', { encryptionScheme: 'pkcs1' })