Skip to content

Instantly share code, notes, and snippets.

View Cloud-Awesome's full-sized avatar

Arthur Nicholson-Gumuła Cloud-Awesome

View GitHub Profile
@Cloud-Awesome
Cloud-Awesome / TeamsSimpleBot.cs
Created May 26, 2022 13:36
Most basic bot in MS Teams using an Outgoing Webhook to an Azure Function
public static class TeamsTester
{
[FunctionName("TeamsTester")]
public static async Task<IMessageActivity> RunAsync(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]
HttpRequest req, ILogger log)
{
// Get the activity passed through from the teams channel
var requestBody = await new StreamReader(req.Body).ReadToEndAsync();
var incomingActivity = JsonConvert.DeserializeObject<Activity>(requestBody);
{% assign stop = false %}
{% assign next_url = "" %}
{% comment %}
Loop through all siblings of the current page (i.e. this page's parent's children)
Unfortunately, I haven't found any other liquid object that allows us to get "next sibling" ;)
{% endcomment %}
{% for child in sitemap.current.parent.children %}
{% comment %} If, in the last itteration, it found the current page, this is the next page, set URL and exit {% endcomment %}
[...]
<div id="csv_data"></div>
<script type="text/javascript">
// '/odata-web-pages' is where I published the sample FetchXml-generated feed
fetch("/odata-web-pages?website-id={{ request.params['website-id'] }}")
.then(response => response.json())
.then((data) => {
const link = document.createElement("a");
{% fetchxml fetch_query %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="adx_webpage">
<attribute name="adx_webpageid" />
<attribute name="adx_name" />
<attribute name="createdon" />
<order attribute="adx_name" descending="false" />
<filter type="and">
<condition attribute="adx_name" operator="not-null" />
<condition attribute="adx_isroot" operator="eq" value="1" />
{% assign links = weblinks[page.adx_navigation.id] %}
<ol class="task-list">
<!-- List "title" links (i.e. those with no parent, in display order -->
{% for link in links.weblinks %}
<li>
<h2 class="task-list-section">
<span class="task-list-section-number">
{{ link["adx_displayorder"] }}.
</span> {{ link.name }}
</h2>
{% assign primary_record_id = request.params("id") %}
{% assign primary_record = entities.new_order[primary_record_id] %}
{% capture snippet_name %}
Order/Complete/{{primary_record.statuscode.label}}
{% endcapture %}
{% editable snippets snippet_name %}
<SolutionName>PluginRegistrationSandbox</SolutionName>
<Clobber>true</Clobber>
<UpdateAssemblyOnly>false</UpdateAssemblyOnly>
<CdsConnection>
<ConnectionType>AppRegistration</ConnectionType>
<CdsConnectionString>...</CdsConnectionString>
<CdsUrl>...</CdsUrl>
<CdsUserName>...</CdsUserName>
<CdsPassword>...</CdsPassword>
@Cloud-Awesome
Cloud-Awesome / SupportCases.cs
Last active May 18, 2020 15:23
Testing Gists from GistPad in VS Code
public class SupportCases
{
[Test]
[Category("Case Management")]
[Description("")]
[Ignore("Test writing is in progress...")]
public void ViewClosedCases()
{
// Arrange
var config = new PortalConfiguration("arthur");