Skip to content

Instantly share code, notes, and snippets.

View clipped-drh-callout.ts
function deriveRunnerLaborHours(pred: CapacityPreds, max_callout_rate: number) {
if (pred.runner_hours_predicted === 0) {
return { finalCapacity: 0 }
}
let predictedDrhWithLimits: number = null
if (pred.drh_predicted < MIN_DRH) {
predictedDrhWithLimits = MIN_DRH
} else if (pred.drh_predicted > MAX_DRH) {
View heroku-fail.log
Applying hasura data to:
https://worthy-leech-90.hasura.app/v1/graphql
{"level":"info","msg":"Help us improve Hasura! The cli collects anonymized usage stats which\nallow us to keep improving Hasura at warp speed. To opt-out or read more,\nvisit https://hasura.io/docs/1.0/graphql/manual/guides/telemetry.html\n","time":"2021-01-13T22:34:07Z"}
{"level":"debug","msg":"global config file exisits, verifying contents","time":"2021-01-13T22:34:07Z"}
{"level":"debug","msg":"global config is pre-set to \u0026cli.GlobalConfig{UUID:\"ebb072c2-9126-4302-af5c-c1598c9ad5f9\", EnableTelemetry:true, ShowUpdateNotification:true, CLIEnvironment:\"default\"}","time":"2021-01-13T22:34:07Z"}
{"level":"debug","msg":"global config: uuid: ebb072c2-9126-4302-af5c-c1598c9ad5f9","time":"2021-01-13T22:34:07Z"}
{"level":"debug","msg":"global config: enableTelemetry: true","time":"2021-01-13T22:34:07Z"}
{"level":"debug","msg":"global config: showUpdateNotification: true","time":"2021
@mikepaszkiewicz
mikepaszkiewicz / user-data.sh
Created Dec 11, 2020 — forked from abhilash1in/user-data.sh
Install nvm and NodeJS using AWS EC2 user data script
View user-data.sh
#!/bin/bash
apt-get -y update
cat > /tmp/subscript.sh << EOF
# START UBUNTU USERSPACE
echo "Setting up NodeJS Environment"
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.9/install.sh | bash
echo 'export NVM_DIR="/home/ubuntu/.nvm"' >> /home/ubuntu/.bashrc
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> /home/ubuntu/.bashrc
# Dot source the files to ensure that variables are available within the current shell
. /home/ubuntu/.nvm/nvm.sh
View drivetimes.html
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Get started with the Isochrone API</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<!-- Import Mapbox GL JS -->
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.6.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.6.1/mapbox-gl.css' rel='stylesheet' />
View geocoder_comparison.ts
import axios from 'axios'
interface GeocodeFeature {
"type": "Feature",
"geometry": {
"type": string,
"coordinates": number[]
},
"properties": {
@mikepaszkiewicz
mikepaszkiewicz / .sh
Created Oct 23, 2019
DevOps Cheat Sheet
View .sh
##HEROKU
#view running processes
heroku ps -a habitat-api-express
#kill running pid/stuck release
heroku ps:kill release.6104 -a habitat-api-express-staging
@mikepaszkiewicz
mikepaszkiewicz / .sh
Last active Oct 8, 2020
Bash Cheat Sheet
View .sh
##FILESYSTEM
# append all .csv files in only one and ignore headers in subsequent files.
#!/bin/bash
OutFileName="X.csv" # Fix the output name
i=0 # Reset a counter
for filename in ./*.csv; do
if [ "$filename" != "$OutFileName" ] ; # Avoid recursion
then
if [[ $i -eq 0 ]] ; then
@mikepaszkiewicz
mikepaszkiewicz / .sql
Last active May 6, 2020
PostgreSQL Cheat Sheet
View .sql
--CONNECTIONS
--check all active connections
SELECT * FROM pg_stat_activity;
--kill all other active connections
SELECT
pg_terminate_backend(pg_stat_activity.pid)
FROM
pg_stat_activity
View gist:30c2aacbf6f583a3ddee0c8a54f3a98c
https://s3.amazonaws.com/downloads.metabase.com/v0.33.3/metabase-aws-eb.zip
@mikepaszkiewicz
mikepaszkiewicz / olo.md
Created Apr 9, 2018
Olo integration steps
View olo.md

Docs: https://dispatch-dsp.readme.io/docs Sandbox: https://vanilla.olosandbox.com/menu/dispatch-tryhabitat/

  • Make sure 26 Broadway New York, NY 10004 is in your coverage area to be able to accept orders.

OLO will test the following before turning on integration: