Arrr, the scrawp (script) be mighty powerful in this one!

Pirates love talking trash, and where better to spew out all the fun than Microsoft Teams?

As a pirate you don’t have too many tools at hand at any given time. The same is true in 2023. Why learn something new when you have your trusty old swiss army knife at hand?

This time around we’re stealing from our own team mate, Mikael, taking one of the most powerful and mis-used plugins of all time, the PnP Script Editor Web Part, and we use it to easily embed our “Pirate “Capture a pirate” canvas app into Teams.

Teams App Admin

It’s as easy as rum and grog, add the Teams Tab, configure it with and <iframe> tag and you’re all set. Because everyone knows iframes as it has been a trusted valid tag for over 20 years now. Who knew you could embed and use a PowerApp within Teams????

Script editor web part – iframe

Once set up – it works beautifully!

Canvas Apps in Teams – such a novel concept

The beauty is that it even works on mobile! Pick the tab and embrace.

Capture a pirate responsibly on a device

And for some extra fun, here’s PirateGTP pirate in SVG – well hidden 😁

The input
The output

Badges and why – because why not

Client side salsa – Everyone knows teams tabs are browser tabs, and iframe’s are all about browser love. No monolithic front-end used, only simple and easy html and scripting.

Thieving bastards – We stole and borrowed the open source PnP script editor web part solution, even though inception was involved. PirateGPT is our API on crew mate generation, and Stable diffusion (via automatic1111) is our image pirateer solution. And not free I tell you as we had to purchase a used Nvidia RTX3060 gfx card to get this going.

Chameleon – What can we say, Teams, stand-alone, browser, native app, what not – you will not get away from being onboarded with out solution. It adapts portrait, landscape, even black and white. PirateGPT will get you!

Plug’nPlay – We stole it with inception, it plugs into anything SPFx plugs into. Showcased in Teams as we just love the purple.

Power User Love – All stored in Dynamic, all surfaced in Teams and SharePoint – we love ya’ll!

Capitan’s log

The Capitan has his own Native app with a useful set of tools to manage the crew and the boat. The App is made in React Native and prepared for mobile phones and tablets.

Features:

Weather forecast

A captain needs to monitor the weather before departure because it can greatly impact the safety and success of a voyage. Dangerous weather conditions such as strong winds, high waves, storms, fog, and ice can affect navigation, visibility, stability, and increase the risk of damage to the ship and crew. By monitoring the weather, the captain can plan a safer and more efficient voyage.

Counting the crew when boarding

A pirate captain would need to count their crew before departure for safety, morale, planning, and order. It helps ensure everyone is accounted for, tasks can be properly allocated, and order is maintained among the crew.

more to come.

The code can be found at: https://github.com/TheBastards-ACDC2023/Bastards-NativeApp

Capture new pirates

When we need new pirates on our crew we have an app where we can take their picture, and the app send the picture to a server that uses AI to piratefy your face.

The app is a Canvas App with a camera control on the first screen

When user click the camera control they navigate to the next screen where they will see their picture.

They can go back and take a new picture if they are not happy, or move on to “Piratefy me”.

If user click the “Pratefy me” button a power automate flow is triggered. We pass the image base64 value as a value and store the reply value in a variable.

The flow is “Me as a Pirate”

The trigger is a power apps trigger.

First we initiate reusable variables

We grab the image value from the Power Automate

Passing the image over to the CLIP service powered by Stable Diffusion at the Frogner/Oslo datacenter we annotate images to mostly correct the gender or non-gender of the person in the photo. This is our responsible way to ensure the pirate representation of the person is not turning the most beautiful guy and girl into something they definitely don’t identify with.

We parse the response we get

Next we pass in the captured photo, and overlay it with some serious pirate’y prompting to ensure our new crew mates meats the bar (and also the real bar when port-side).

We need to modify the image string to make it the right format for the Ai to handle.

We trigger a child flow (documented further down)

We gather the reponse and send it back to the Power App.

The flow triggered as a Child flow is called “get Crew Member Data – PirateGDP”

The core API in out solution is PirateGPT, a large language model fully capable assigning awesome pirate names and corresponding ships, with the identifiable traits of the pirate. Which we as a responsible HR ship keep fully secure and up to date as needed. When you have seven John’s on one ship, it’s quite important to distinguish them by traits such as red beard or cock farmer.

We PARSE the results we get for get the right format

Respond with the values to the “parent” flow

The Power App

Back in the Canvas App the user will see the newly created name and their picture Piratified:

It also navigate to the next screen where they will see the pirate name they are given and their picture Piratified.

If this isnt glossy and extreme business value, I don’t know what is?

Imagine this being a manager taking pictures of new employees. We all know that Gen Z are used to looking at themselves with prettifying filters. This way the old middle manager can take pictures of their new employees and let Open AI add the familiar filters so that when the Gen Z employee see their own new profile picture they will actually recognize themselves.

Badges

Glossy Pixels – because pirates are beautiful.

Go with the Flow – because it’s all flowing left and right

The Existential Risk – Who knew LLM could be used to generate schematized JSON data structures, and who knew all those crazy internet pics would be the basis for pirate faces of 2023?

ACDC Craftman – All API’s are tested and documented in a shared Postman collection, all is ran over https (not from the beginning) to avoid photo snooping, and API keys are used as the extra layer. No one wants to be the next TMZ victim!

Can crazy days create value?

First of all I have to thank you all for letting in a first time hackathon bastard in the realm of this wild pirate bunch. I have tried to catch up, learn and provide some help for my Captain Ulrikke. What I thought would be a lot of power naps, turned out to be PowerApps, aaarr!

As an architect I have realised that there are so many more ways to Rome. The creativity, cooperation, team spirit and knowledge gathered in a room is amazing. As a bastard on a ship I have learnt about flows, power apps, dataverse, canvas and the myriad of possibilities for creating solutions in alternative ways.

I started asking chatGPT for lyrics and chords for a pirate song. A soft start for an old musician to add som team spirit, playing on a broken electric piano and singing with the voice the sea and rum gave me.

But I do believe that the value from the experience this weekend has broadened my mind. I met incredible people in a cool atmosphere and will be able to build on my knowledge.

I hope this was the start of more hackathons. I will end with a homage to my fellow pirate who gave me a cool cap gadget (Marius).

Because I care to share!

For this we deserve the “Community Champion” badge:

And “Sharing is caring”

On my way to solve the ongoing Head 2 Head Challenge I came across a blog article that might be a way of solving the challenge.

It’s more important to me that my fellow contestants and rivals learn more about Power Pages – then it is for me to win the challenge – I would like to share this blog article with you.

Hot tip for the next Head 2 Head challenge: When you google for answers, include the name of the person providing the challenge šŸ˜‰

This will not take you all the way, but it’s a theoretical solution to the Head 2 Head Challenge.

Best of luck – and may the fastest developer win!

#Sharin’BeCarrin

Arrr, ’tis true what ye say. In this age of Artificial Intelligence and large language models, ’tis important that we share our learnings and explorations with fellow scalawags for innovation.

We hope Evidi releases the Kraken of Nvidia image generation promptingā€¦ and ye’d best keep that shenanigan within pirate domains!

When harnessing tha powers of prompting, we keep our sample API requests tucked away in a Postman collection. Easy to use, easy to share! #ShareAlike, me hearties! #Sharin’BeCarrin’!

#PirateGPT #FTW

Smack my JSON up – and why size matters

Power Automate loves talking to API’s. API’s love talking in JSON. Because why not, we’re in 2023 where curly braces are the equivalent of the human hug – just embrace it already, and grab what you need 3 levels deep. Dot, dot dot. Easy as a dot.

But what happens when you embrace too much? I mean, we’re in 2023 where size has grown (out of proportion) compared to the skinny 70’s. And we’re talking simplistic CSV files here in case your mind was wandering into the land of political correctness. Just saying.

Either way. If the body of JSON is too large, a tad over 0.5MB, Power Automate nullifies it, which prevents you from getting to the property you want. That’s quite the statement.

Fortunately JSON has a string body, and strings can be cut at the front and the back, scissor scissor, slice slice. Let’s strip the away the bloat, grab the good meat, and let JSON be JSON for the time being.

We’re willing to debate if string manipulation is a nasty hack, but this is what PirateGPT has to say about that: “Arrr, string manipulation be a nasty hack in 2023, as it be a shortcut that don’t stand the test of time. It be a quick fix, but be sure to find a more permanent solution before ye be walkin’ the plank!”

And there is no question it’s retro, or as PirateGPT says: “Arrr, ye scurvy dogs! String manipulation may be a tried and true technology, but it’s been outdone by more modern techniques like natural language processing and machine learning. So in 2023, it’s a bit of a retro technology.”

The Mutiny Appy

As a Captain on me ship The Moria (my first ship Lady Soria was tragically lost during a mutiny, fuck’en ol’ crew) I found the need to prevent further incidents. Arrrr!

An App (handy while sword fighting) to manage how to split the loot so the my crew, the Bastards, will be happy and serve me loyally and eagerly is what I will make.

Built on stolen tech, open pirate intelligence, and brut forcing powerapps I will control the pirate hierarchy and move my mates up only when necessary.

Our hierarchy consist of:
Captain (only ME)
Quartermaster
First Mate
Boatswain
Surgeon
Sailors
Captives

The app will also provide essential tools and games for my crew in order to keep them happy and informed during pirating. It will guide them through adult virtual entertainment and show them the way to the next rum bar.

Frist draft architecture made in an rumble

Technologies:

Data model