Skip to content

Instantly share code, notes, and snippets.

View minmaxdata's full-sized avatar
🐕

Ke McAdams minmaxdata

🐕
  • DTN
  • Seattle, WA
View GitHub Profile
@minmaxdata
minmaxdata / webpack.config.js
Last active October 25, 2019 23:03
my webpack
const path = require('path');
const SRC_DIR = path.join(__dirname, '/client/src');
const DIST_DIR = path.join(__dirname, '/client/dist');
module.exports = {
mode: 'none',
entry: `${SRC_DIR}/index.jsx`,
output: {
filename: 'bundle.js',
path: DIST_DIR,
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@minmaxdata
minmaxdata / loadtest.yml
Last active September 25, 2019 23:17
LOad test for proxy
config:
target: 'http://localhost:3000'
phases:
- duration: 60
arrivalRate: 5
- duration: 120
arrivalRate: 5
rampTo: 50
- duration: 600
arrivalRate: 50
@minmaxdata
minmaxdata / loadtest.yml
Last active September 25, 2019 23:12
artillery load test for nearby module
config:
target: 'http://localhost:3001'
phases:
- duration: 60
arrivalRate: 5
- duration: 120
arrivalRate: 5
rampTo: 50
- duration: 600
arrivalRate: 50
@minmaxdata
minmaxdata / dbqueries.gist
Last active September 19, 2019 23:17
HRR40 SDC Queries and results
Mac Book Pro
MacBook Pro (Retina, 13-inch, Mid 2014)
Processor 2.6 GHz Intel Core i5
8 GB 1600 MHz DDR3
POSTGRES
testdb=# EXPLAIN ANALYZE SELECT * FROM testschema.listing;
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------
Seq Scan on listing (cost=0.00..214433.65 rows=10001565 width=59) (actual time=1.003..2149.797 rows=9999996 loops=1)
@minmaxdata
minmaxdata / restaurant_recommendation.adoc
Created September 14, 2019 21:05 — forked from jexp/restaurant_recommendation.adoc
Restaurant Recommendation GraphGist

Restaurant Recommendations

We want to demonstrate how easy it is to model a domain as a graph and answer questions in almost natural language.

Graph Based Search and Discovery is prominent a use-case for graph databases like Neo4j.

@minmaxdata
minmaxdata / graph_gist_template.adoc
Last active September 14, 2019 21:10 — forked from jexp/graph_gist_template.adoc
CHANGEME: GraphGist Template. Fork to make your own, view source to see instruction comments

NEARBY LISTINGS

Introduction

@minmaxdata
minmaxdata / Reviews
Created August 27, 2019 21:35
Customer reviews api call get all reviews
get http://localhost:3000/api/product/reviews?productId=10
response:
[
[
{
"ratings": {
"quality": 1,
app.get("/my-view", async (req, res) => {
res.send(render("my-view", {data: await db.getData()}))
})
function render(view, ctx = {}) {
return _.template(fs.readFileSync(`./views/${view}.html`))(ctx)
}
@minmaxdata
minmaxdata / base64-image-upload.js
Created August 3, 2019 18:31 — forked from madhums/base64-image-upload.js
save base64 encoded image
/*
* Taken from http://stackoverflow.com/questions/5867534/how-to-save-canvas-data-to-file/5971674#5971674
*/
var fs = require('fs');
// string generated by canvas.toDataURL()
var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0"
+ "NAAAAKElEQVQ4jWNgYGD4Twzu6FhFFGYYNXDUwGFpIAk2E4dHDRw1cDgaCAASFOffhEIO"
+ "3gAAAABJRU5ErkJggg==";
// strip off the data: url prefix to get just the base64-encoded bytes