Skip to content

Instantly share code, notes, and snippets.

View darrensapalo's full-sized avatar

Darren darrensapalo

View GitHub Profile
@darrensapalo
darrensapalo / akp-no-complete.md
Last active February 20, 2021 06:16
Tinkering with Faith

Context

Faith: the gist is I wanted to send a response (just to test) when everything completed, but it no longer did subscription 'complete' callback after I added graphql mutations/queries. the queries/mutations work and reflect in the DB. do i be missing somethin like am I using the apollo functions wrong?

Code snippet

  const process$ = of(configuration).pipe(
      tap((config) => (configuration = config)),
@darrensapalo
darrensapalo / process-gps-logs.fish
Last active January 8, 2021 03:01
Process log data from paper trail
#! /usr/bin/fish
# Step 1: Copy paste log file from paper trail
# Step 2: Save data into file, where each line looks like the following:
# Dec 20 22:22:11 staging[delivery-service-hasura-58f69d58f6-2cxhl {"type":"query-log","timestamp":"2020-12-21T06:22:11.043+0000","level":"info","detail":{"request_id":"616a3367629d8b436e3b0e79ba14f401","generated_sql":null,"query":{"variables":{"driver_id":"ea078cc9-28b8-40d6-8647-3141450fd683","location_details":{"uuid":"98ce4b1b-dfaa-4916-883e-a22724e48f05","is_moving":true,"odometer":6073.2,"activity":{"confidence":100,"type":"still"},"battery":{"is_charging":true,"level":0.99},"timestamp":"2020-12-21T06:22:10.410Z","coords":{"heading_accuracy":-1,"speed_accuracy":-1,"heading":-1,"latitude":26.1890645,"speed":-1,"altitude_accuracy":-1,"accuracy":1602,"altitude":-1,"longitude":50.5934393},"sample":true,"extras":{}}},"operationName":"UpdateDriverLocation","query":"mutation UpdateDriverLocation($driver_id: uuid!, $location_details: jsonb) {\n update_drivers(\n where:
@darrensapalo
darrensapalo / gw360 generate kpi
Created October 17, 2020 06:11
generating kpi from employee data from omnivore
Attaching to gw360-backend_gw360-backend_1
gw360-backend_1 | Successfully parsed whitelist. Found:
gw360-backend_1 | - http://localhost:8080
gw360-backend_1 | App running on port 3000.
gw360-backend_1 | session id -> HFL7kr7lyeUaneyC5k8J28S8HoBtdCFW
gw360-backend_1 | rememberMe: true
gw360-backend_1 | login success -> ihop-test-user@sample.com
gw360-backend_1 | session restaurant ID -> 39
gw360-backend_1 | Processed a total of 0 employees for restaurant [1].
@darrensapalo
darrensapalo / GW360 Update.md
Created October 15, 2020 06:05
Planning for deployment by Oct 19, 2020

Meeting

Thursday, October 15, 11:30AM-1:00PM (PHT)

  • Seth
  • Darren
  • Baron
  • Drew

Expected Timeline

@darrensapalo
darrensapalo / tasks.json
Created September 16, 2020 05:28
task json for building golang handlers for hasura services
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Download dependencies",
"type": "shell",
"command": "${env:GOROOT}/bin/go",
"args": [
@darrensapalo
darrensapalo / restart-docker-service.sh
Created August 21, 2020 03:45
I'll usually need to do this if there were port issues that cause the containers to not be able to restart.
#! /bin/sh
# This restarts the whole docker service.
#
# I'll usually need to do this if there were port issues that cause the containers to not be able to restart.
service docker restart
@darrensapalo
darrensapalo / docker-cleanup.sh
Created August 18, 2020 03:59
Clean up docker images with <none>
#! /bin/sh
IMAGE_IDS=$(docker image ls | grep '<none>' | sed -r 's/.*([a-f0-9]{12}).*/\1/g')
echo "Deleting $IMAGE_IDS"
docker image rm $IMAGE_IDS
@darrensapalo
darrensapalo / testdata.txt
Created June 5, 2020 13:00
test 100 data csv rapidpass
passType,aporType,firstName,middleName,lastName,suffix,company,idType,identifierNumber,platenumber,mobileNumber,email,originName,originStreet,originCity,originProvince,destName,destStreet,destCity,destProvince,remarks
INDIVIDUAL,AG,mykLsiqi,midsiqi,lastsiqi,V,DevCon PH 0,DFA,BULK0407-0832PM-0,,09175983424,darren.sapalo@gmail.com,Origin,484536 siqi Street,Ligao City,Sorsogon,Destination,0 siqi Road,Para�aque City,Zamboanga del Sur,test remark 1586268473.6676080
INDIVIDUAL,BA,mykLmoqu,midmoqu,lastmoqu,IV,DevCon PH 1,PWD,BULK0407-0832PM-1,,09354936694,diazjezza@gmail.com,Origin,371238 moqu Street,Valenzuela City,Southern Leyte,Destination,1 moqu Road,Muntinlupa City,Zamboanga,test remark 1586268473.6676081
INDIVIDUAL,PH,mykLrime,midrime,lastrime,IV,DevCon PH 2,POS,BULK0407-0832PM-2,,09188181951,wdamarillo@agsx.net,Origin,943958 rime Street,Pasig City,Quezon,Destination,2 rime Road,Malabon City,Albay,test remark 1586268473.6676082
INDIVIDUAL,LW,mykLqara,midqara,lastqara,X,DevCon PH 3,SSS,BULK0407-0832PM-3,,091783
@darrensapalo
darrensapalo / notes.ts
Created June 2, 2020 09:14
Discussions with Baron regarding dynamic processing
import { OperatorFunction, pipe, from } from 'rxjs';
import { map, tap } from 'rxjs/operators';
import axios from 'axios';
interface Operation {
// config yml
type: 'map'|'filter';
};
const operations: Operation[] = [];
@darrensapalo
darrensapalo / coborrower-form-address-activation-bug.log
Created February 5, 2020 13:58
Address activation bug on coborrower form
main-es2015.js:36436 StorageHandler: Successfully constructed the storage handler.
main-es2015.js:36436 APIService: Successfully created the API Service.
vendor-es2015.js:68662 Angular is running in the development mode. Call enableProdMode() to enable the production mode.
vendor-es2015.js:96250 Ionic Native: deviceready event fired after 949 ms
main-es2015.js:36456 App: JWT in localStorage does not exist.
warn @ main-es2015.js:36456
main-es2015.js:36436 App: Platform is now ready.
plugins/cordova-sqlite-storage/www/SQLitePlugin.js:175 OPEN database: _ionicstorage
plugins/cordova-sqlite-storage/www/SQLitePlugin.js:106 new transaction is queued, waiting for open operation to finish
plugins/cordova-sqlite-storage/www/SQLitePlugin.js:179 OPEN database: _ionicstorage - OK