Skip to content

Instantly share code, notes, and snippets.

View GeneralistDev's full-sized avatar
🏠
Working from home

Daniel Parker GeneralistDev

🏠
Working from home
View GitHub Profile
@GeneralistDev
GeneralistDev / results.csv
Last active May 8, 2021 21:12
Algolia vs Postgres Benchmark Results
Test Data Store Batch Size Batches Query Average query time (ms)
Simple Low Postgres 1 10 Simple 54.22070313
Simple Low Algolia 1 10 Simple 6.633463542
Simple Med Postgres 10 10 Simple 856.8292969
Simple Med Algolia 10 10 Simple 11.73763021
Simple High Postgres 10 100 Simple 7101.196888
Simple High Algolia 10 100 Simple 15.05933923
Complex Low Postgres 1 10 Complex 68.72591146
Complex Low Algolia 1 10 Complex 6.804036458
Complex Med Postgres 10 10 Complex 843.3528646
import base64
from flask import Flask,jsonify, request
from flask_cors import CORS
import os
import sys
import cv2
from collections import Counter
from datetime import datetime
import face_recognition
@GeneralistDev
GeneralistDev / main.py
Created June 13, 2020 14:54
Just some basic logic
if __name__ == "__main__":
if (len(sys.argv) != 2): # Checks if image was given as cli argument
print("error: syntax is 'python main.py /example/image/location.jpg'")
else:
BackgroundColor = BackgroundColorDetector(sys.argv[1])
average_color = BackgroundColor.detect()
WhiteList = [
(255, 255, 255),
#... The rest of the shades
if __name__ == "__main__":
if (len(sys.argv) != 2): # Checks if image was given as cli argument
print("error: syntax is 'python main.py /example/image/location.jpg'")
else:
BackgroundColor = BackgroundColorDetector(sys.argv[1])
average_color = BackgroundColor.detect()
print(average_color)
# renderer = ColorRenderer(average_color)
# renderer.render()
@GeneralistDev
GeneralistDev / main.py
Created June 9, 2020 15:39
Approach 2 with color visualization window
import sys # System bindings
import cv2 # OpenCV bindings
import numpy as np
from PIL import Image
from collections import Counter
class ColorRenderer():
def __init__(self, rgb):
self.rgb = rgb
@GeneralistDev
GeneralistDev / machine.js
Last active February 24, 2020 17:30
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@GeneralistDev
GeneralistDev / GlobalErrorMessageInterceptorFactory.js
Created July 10, 2019 22:06
Global error handling angularjs
(function() {
'use strict';
angular.module('app')
.config(['$provide', function($provide) {
$provide.decorator('$http', ['$delegate', '$timeout', '$injector', Decorator]);
function Decorator($delegate, $timeout, $injector) {
function displayAlertModal(message, validationMessages) {
return $timeout(function() {

Keybase proof

I hereby claim:

  • I am GeneralistDev on github.
  • I am codymccodeface (https://keybase.io/codymccodeface) on keybase.
  • I have a public key whose fingerprint is D0A7 15A1 ED90 AD09 531D 9F4F E55A FB73 20BD 3402

To claim this, I am signing this object:

@GeneralistDev
GeneralistDev / cfn-ami-example.json
Created September 29, 2018 00:21
EC2 ImageId example
{
"Type" : "AWS::EC2::Instance",
"Properties" : {
"ImageId" : "ami-d5d9eeb6"
}
}
@GeneralistDev
GeneralistDev / trekksoft.js
Created September 28, 2018 21:01
trekksoft code
<center><a id="trekksoft_7970" href="#"><img title=" Book Now " src="https://takiri-travel.trekksoft.com/cache/images/widget-buttons/eyJsYWJlbCI6Ilwvd2lkZ2V0XC9ib29rLWJ1dHRvbi5wbmciLCJjYXB0aW9uIjoiICAgICAgICAgIEJvb2sgTm93ICAgICAgICAgICAiLCJmb3JlQ29sb3IiOiIjZmZmZmZmIiwiYmFja0NvbG9yIjoiI2U4NDEyYSJ9.png" alt=" Book Now " border="0" /></a></center><script src="https://takiri-travel.trekksoft.com/en/api/public"></script>
<script>
(function() {
var button = new TrekkSoft.Embed.Button();
button
.setAttrib("target", "fancy")
.setAttrib("entryPoint", "tour")
.setAttrib("tourId", "218638")
.setAttrib("referral", "TAKIRITRAVEL")
.setAttrib("fancywidth", "615px")