Skip to content

Instantly share code, notes, and snippets.

View mikeacjones's full-sized avatar
🚀

Michael Jones mikeacjones

🚀
View GitHub Profile
[
{
"v": 2,
"name": "00 - Sign Ups",
"folders": [],
"requests": [
{
"v": "4",
"name": "Login",
"endpoint": "<<crapi-web>>/identity/api/auth/login",
version: "3.0"
services:
plex:
image: ghcr.io/linuxserver/plex
container_name: plex
network_mode: host
environment:
- PUID=1000
- PGID=1000
- VERSION=docker
<profiles>
<profile>
<id>active-on-windows</id>
<activation>
<os>
<family>Windows</family>
</os>
</activation>
<dependencies>
<dependency>
@mikeacjones
mikeacjones / bai-sucks.dwl
Last active July 28, 2021 20:25
About all I can say about this is that it works for this specific use case.. will need to evaluate again at some point to try and find improvements. Maybe. If I can work up the energy to care about this cursed file format.
%dw 2.0
fun parseBAI(payload: String) : Object = do {
payload splitBy /\/?\r?\n/ reduce ((line, accum={ Accounts: []}) -> (
baiFuncs[line[0 to 1]](line splitBy ',', accum)
))
}
fun baiHeader(payload: Array<String>, accum: Object) : Object =
accum ++ Header: {
@mikeacjones
mikeacjones / UpdateExample.dwl
Created June 24, 2021 12:49
Provides an example of the update function using a pattern matching pattern.
%dw 2.0
output application/json
---
payload update {
case value at .software.name if (value contains "XYZ") -> "XYZ FHIR 2017"
case value at .software.version -> "1.0.0"
case value at .software.releaseDate -> "2017-03-06T00:00:00Z"
case value at .date if(!isEmpty(value)) -> "2017-03-06T00:00:00Z"
case value at .version if(!isEmpty(value)) -> "1.0.0"
case value at .copyright if(!isEmpty(value)) -> "Copyright XYZ 2017"
%dw 2.0
output application/json
fun myFunc(a: Array<String> | String) = a match {
case is Array<String> -> $ joinBy ','
else -> a
}
---
myFunc(["Test", "Test2"])
#%RAML 1.0
title: Punchh sAPI
description: System API that provides JWT based access to Punchh.
types:
Coupon:
type: object
properties:
code:
type: string
#!/bin/sh
# ASSIGN ENVIRONMENT VARIABLES HERE
export securePropertiesKey=123
export keyOne=123
export keyTwo=123
# DO NOT EDIT BELOW
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
@mikeacjones
mikeacjones / jwt.dwl
Created April 19, 2021 22:37
Dataweave JWT Creation
%dw 2.0
import HMACBinary from dw::Crypto
import toBase64 from dw::core::Binaries
fun binaryJson(obj: Object) =
write(obj, 'application/json', { indent: false }) as Binary
fun base64URL(str: Binary) =
toBase64(str) replace "+" with "-" replace "/" with "_" replace "=" with ""
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>queue-to-synapse-papi</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>mule-application</packaging>