Skip to content

Instantly share code, notes, and snippets.

View phpmaps's full-sized avatar
💭
Lending a helping hand on the web.

Doug Carroll phpmaps

💭
Lending a helping hand on the web.
View GitHub Profile
@phpmaps
phpmaps / govt_validation.py
Created October 19, 2022 04:13
Gov Validation Example
def government_validation(self):
start_time = time.time()
r = self.s.post(
self.base_url + 'process/government-validation',
json={},
)
self._add_resp_to_summary('gvnmt', r)
@phpmaps
phpmaps / doc.md
Last active October 7, 2022 01:16
Incode Web Hook Events
@phpmaps
phpmaps / scores.md
Last active October 7, 2022 01:03
Scoring changes

See Overall Status expecation when ML detects paper

In addition to "OK", "WARN", "FAIL", and "UNKNOWN", values you can expect "MANUAL".

{
  ...
  
	"appliedRule": {
 "name": "Manual Review for Paper ID#m57lllln",
await IncodeSdk.createOnboardingSession({ sessionConfig: { configurationId: "XXXXXX" } });
setOnboardingStatus('starting_segment1');
try {
const ret = await IncodeSdk.startOnboardingSection({
config: [
{
module: 'IdScan',
showTutorial: false
},
],
@phpmaps
phpmaps / find-ip.md
Created April 9, 2022 18:19
Find ip

Find IP Address

Wired

ipconfig getifaddr en1

Wireless

ipconfig getifaddr en0
@phpmaps
phpmaps / poll.php
Last active March 25, 2022 19:18
PHP Polling
<?php
// These are the OCR Data and Status Checking Endpoints.
// Note each has a querystring that takes the interviewId value
// omni/get/ocr-data?id={{interviewId}}
// omni/get/onboarding/status?id={{interviewId}}
// Polling concept
@phpmaps
phpmaps / anonymous.js
Created August 18, 2021 02:33
anonymous
(async () => {
// code goes here
})()
@phpmaps
phpmaps / favoriteRouter.js
Last active August 18, 2021 00:55
favorites data management - web service
const express = require('express');
const favoriteRouter = express.Router();
const authenticate = require('../authenticate');
const Favorite = require('../models/favorite');
const cors = require('./cors');
favoriteRouter.route('/')
.options(cors.corsWithOptions, (req, res) => res.sendStatus(200))
.get(cors.cors, authenticate.verifyUser, (req, res, next) => {
Favorite.find({ user: req.user._id })
@phpmaps
phpmaps / example.js
Created August 11, 2021 06:35
Route example
const express = require('express');
const Campsite = require('../models/campsite');
const authenticate = require('../authenticate');
const campsiteRouter = express.Router();
campsiteRouter.route('/')
.get((req, res, next) => {
Campsite.find()
.populate('comments.author')
@phpmaps
phpmaps / authenticate.js
Last active August 11, 2021 16:08
authenticate-middlewear.js
// Reusable middlewear which checks to see if a user can modify comments
const Campsite = require('./models/campsite');
exports.canModComments = async (req, res, next) => {
const campsite = await Campsite.findById(req.params.campsiteId);
if (campsite.comments.id(req.params.commentId).author.equals(req.user._id)) {
req.campsite = campsite; //Add more stuff to the req object
return next();