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 gist:2c76828218e2cfbd97ca5ee9c433e73e
01-03 10:29:10.684 1557 4901 D HwConnectivityServiceEx: set cache by key is 10158 interfaceName iswlan0 value is false
01-03 10:29:11.169 27724 27724 I aptouch_daemon: filter_touch_detect, down, in: 1, out: 1
01-03 10:29:11.170 1557 1852 D libfingersense_wrapper: Calling fingersense_classify_touch()
01-03 10:29:11.174 1557 1852 D libfingersense_wrapper: fingersense_classify_touch() finished
01-03 10:29:11.277 3379 10242 I HwCommBoosterService: reportBoosterPara enter: com.android.server.dns
01-03 10:29:11.278 3379 10242 I HwCommBoosterManager: reportBoosterPara exit: com.android.server.dns
01-03 10:29:11.279 3379 3492 I OllieBoosterPlugin: receiveAPModuleData
01-03 10:29:11.279 3379 3492 I DollieDcTracterAdapter: onReceiveAPModuleData dataType801
01-03 10:29:11.302 27724 27724 I aptouch_daemon: filter_touch_detect, all_touch_up
01-03 10:29:11.307 633 20784 I netd : trafficSwapActiveStatsMap() <10.34ms>
View gist:d1f4027723c13178da6cc79060c3d600
=> Started your app.
=> App running at: http://localhost:3000/
=> Errors executing Cordova commands:
While running Cordova app for platform Android with options --buildConfig,/Users/monsterstep/dev/sandbox2020/mobileauth/.meteor/local/cordova-build/build.json,--device:
Error: Command failed: /Users/monsterstep/dev/sandbox2020/mobileauth/.meteor/local/cordova-build/platforms/android/cordova/run --buildConfig /Users/monsterstep/dev/sandbox2020/mobileauth/.meteor/local/cordova-build/build.json --device
/Users/monsterstep/dev/sandbox2020/mobileauth/.meteor/local/cordova-build/platforms/android/app/src/main/AndroidManifest.xml:73:9-91 Error:
Element meta-data#JPUSH_APPKEY at AndroidManifest.xml:73:9-91 duplicated with element declared at AndroidManifest.xml:15:9-91
/Users/monsterstep/dev/sandbox2020/mobileauth/.meteor/local/cordova-build/platforms/android/app/src/main/AndroidManifest.xml Error:
View express.md
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' })
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 Feb 11, 2020
docker-compose rs init
View docker-compose.yml
version: '3'
services:
mongo1:
hostname: mongo1
container_name: localmongo1
image: mongo
restart: always
expose:
- 27017
ports:
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)
You can’t perform that action at this time.