Skip to content

Instantly share code, notes, and snippets.

😎
🇰🇵我们晚上去

crapthings crapthings

😎
🇰🇵我们晚上去
Block or report user

Report or block crapthings

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View parser.js
const parser = str => {
let ops = []
let method, arg
let isMethod = true
let open = []
for (const char of str) {
// skip whitespace
if (char === ' ') continue
View gist:18fe20fe7fbeb25007a88fd4ee3f06f8
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,
@crapthings
crapthings / docker-compose.yml
Last active Oct 28, 2019
docker-compose rs init
View docker-compose.yml
version: '3'
services:
mongo1:
hostname: mongo1
container_name: localmongo1
image: mongo
expose:
- 27017
ports:
- 27017:27017
View rs.sh
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' } ] })"
@crapthings
crapthings / a-mongodb-replica-set-docker-compose-readme.md MongoDB Replica Set / docker-compose / mongoose transaction with persistent volume
View a-mongodb-replica-set-docker-compose-readme.md

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!

View gist:eb8a6b20283054390133d8157114ac21
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)
View gist:81aa577b6eb62187d882ae45fadb4f01
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)
View _Self-Hosted-Kadira-APM-Docker-Compose -Ubuntu.md

1 - Get an Ubuntu machine up and running (make sure ports 11011 and 4000 are open)

2 - Install docker + docker-compose (full_install_docker_compose.sh)

3 - Get a docker-compose.yml with mongodb, kadira-ui, kadira-engine and kadira-rma (docker-compose.yml)

3 - Run "sudo docker-compose up" (-d if you want it running on background)

4 - Access http://machineIp:4000 and login as "admin@gmail.com" and "admin" password

5 - Create your APP, get the ID and Secret

6 - Setup kadira in your app by code or settings.json (Config)

7 - Update your app from "free" plan to "paid" to get full access at Kadira ([Update App Plan](https://gist.github.com/6uimorais/1e1de20bbbb2a04fe19fc73f88d6a25f#file-changepl

View gist:8d2d0b23e6ae6da684767ac0e95c48b8
This file has been truncated, but you can view the full file.
#define
#endif
#if
#ifdef
#ifndef
#import
#include
#pragma
%d
View gist:d2b49b05ffeae8ea03d45cb6c45a1c5c
决议
决定
命令(令)
公报
公告
通告
意见
通知
通报
报告
You can’t perform that action at this time.