Skip to content

Instantly share code, notes, and snippets.

View liwoo's full-sized avatar
🎯
Focusing

Jeremiah Chienda liwoo

🎯
Focusing
View GitHub Profile
@liwoo
liwoo / onboarding-machine2.js
Created January 15, 2022 19:43
Onboarding State Machine
const onBoardingMachine = createMachine(
{
id: 'app',
initial: 'initializing',
states: {
initializing: {
on: {
INITIALIZED: 'checkingAuthentication' //async checkAuthenticated -> Firebase
}
},
@liwoo
liwoo / onbaording-machine.js
Created December 31, 2021 02:42
Simple Onboarding State Machine
import { createMachine } from 'xstate';
const idToken = 54
const boarded = [12, 18, 54]
const onBoardingMachine = createMachine({
id: 'app',
initial: 'uninitialized',
states: {
uninitialized: {
version: "2"
services:
app:
image: jeremiahchienda/tnm-data-usage-app:latest
ports:
- "${APP_PORT}:80"
environment:
CONTAINER_ENV: "${APP_ENV}"
DB_INSERT_CHUNK_SIZE: "${DB_INSERT_CHUNK_SIZE}"
CDR_QUEUES: "${CDR_QUEUES}"
@liwoo
liwoo / sync-gateway.conf.json
Created May 15, 2020 15:24
Sync Gateway Config
{"log":["*"],"CORS":{"Origin":["http://localhost:1234","http://localhost:4200","http://localhost:4300"],"LoginOrigin":["http://localhost:1234","http://localhost:4200","http://localhost:4300"],"Headers":["Content-Type","Authorization"]},"databases":{"fs_db_v0":{"server":"http://159.203.117.96:8091","bucket":"fs-bucket-v0","username":"bucket_user","password":"password","enable_shared_bucket_access":true,"import_docs":true,"num_index_replicas":0,"sync":"function(doc, oldDoc) {\n if (doc.replRole) {\n requireRole('replicator');\n if (doc.replRole !== 'replicator') {\n requireRole(doc.replRole);\n channel(doc.replRole);\n if (doc.channels && doc.channels.length) {\n doc.channels.each(function(channel) {\n channel(doc.replRole + '_' + channel);\n });\n }\n }\n } else {\n requireRole('sync_daemon');\n channel(doc.channels);\n }\n}","users":{"test":{"password":"password","admin_channels":["*"]},"sync_daemon_user":{"password":"password","admin_roles":["sync_
@liwoo
liwoo / DriverRatingsAPI.php
Created June 4, 2019 12:50
Class Implementing CTrack Integration
<?php
namespace App\APIs;
use Carbon\Carbon;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
use Illuminate\Support\Facades\Storage;
use function GuzzleHttp\json_decode;
use Illuminate\Contracts\Filesystem\FileNotFoundException;
@liwoo
liwoo / DriverRatingsAPI.php
Created March 20, 2019 14:43
Interface and Fake Implementation of Driver Ratings Class that will be communicating with CTrack
<?php
namespace App\APIs;
use Faker;
use Carbon\Carbon;
//TripData Model Class
class TripData
{
const resourceResourceTypeMapping = {
[refs.RESOURCE_TYPES.TRANSPORT]: [{
resource_name: "Motor Vehicle Ambulances",
description: "This facility has one ambulance that is operational"
},
{
resource_name: "Vehicles/Cars",
description: "This facility has no Vehicles or cars"
},
{

As a User, I can View All Previous OpenLMIS Migrations

Request

GET /migrations/openlmis/

Response

  [
    {
 migration_id: UUID,
@liwoo
liwoo / footer.html
Created October 30, 2018 10:43
SparcSystemsFooter

##Integration Tests

###As A User … ####I Can View All Previous Synchronizations

#####GET /synchronizations

[{
	synchronizationId: "string",
	totalFacilitiesAdded: "string",