Skip to content

Instantly share code, notes, and snippets.

View emoran's full-sized avatar
:octocat:
Developing

Edgar Moran emoran

:octocat:
Developing
View GitHub Profile
%dw 2.0
output application/java
---
[{
"First Name":"Anne",
"Last Name":"Smith",
"email":"anne@email.com",
"Company":"ACME INC",
id:"1821dd44"
},
@emoran
emoran / removeArray.xml
Created December 21, 2020 15:44
Removes array object from other with Dataweave 1.0
<flow name="dataweaveFlow">
<poll doc:name="Poll">
<fixed-frequency-scheduler frequency="1" startDelay="100" timeUnit="DAYS"/>
<logger message="tets" level="INFO" doc:name="Logger"/>
</poll>
<dw:transform-message doc:name="DropThese" metadata:id="096bae40-aafe-4bcd-bdaa-183fdd1fded6">
<dw:input-payload/>
<dw:set-variable variableName="DropThese"><![CDATA[%dw 1.0
%output application/java
---
@emoran
emoran / JWTGenerator.java
Last active March 19, 2024 02:12
Generares a Signed JWT token based on RSA private key pulled from local file
package com.emoran;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.Signature;
import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.net.ftp.FTPReply;
import org.apache.commons.net.ftp.FTPSClient;
import org.mule.api.MuleMessage;
import org.mule.api.transformer.TransformerException;
@emoran
emoran / gist:f1300b436f79b247dc693a542068cfe5
Created November 3, 2020 17:04
Dataweave escape double quotes.
<dw:transform-message doc:name="CSV to Object">
<dw:input-payload mimeType="application/csv">
<dw:reader-property name="separator" value="," />
<dw:reader-property name="header" value="true" />
<dw:reader-property name="quote" value="&quot;" />
<dw:reader-property name="escape" value="&quot;&quot;" />
</dw:input-payload>
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
# Maven
# Aurthor: Edgar Moran
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
trigger:
- test
- emoran
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
@emoran
emoran / pom.xml
Created September 19, 2020 12:18
<?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.emoran</groupId>
<artifactId>yucelmoran-azure-pipeline</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>mule-application</packaging>
<name>yucelmoran-azure-pipeline</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>yucelmoran-azure-pipeline</id>
<username>yucelmorans</username>
<!-- Treat this auth token like a password. Do not share it with anyone, including Microsoft support. -->
<!-- The generated token expires on or before 17/11/2019 -->
<password>${azure.password}</password>
</server>
#%RAML 1.0
title: Sample API
/persons:
get:
responses:
200:
body:
application/json:
example: |