Skip to content

Instantly share code, notes, and snippets.

Matti Petrelius petmat

Block or report user

Report or block petmat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View EntityFunction.cs
public static async Task Counter(
[EntityTrigger] IDurableEntityContext ctx)
int currentValue = ctx.GetState<int>();
int operand = ctx.GetInput<int>();
switch (ctx.OperationName)
case "add":
View AzureFunctionsDI.cs
[assembly: FunctionsStartup(typeof(MyNamespace.Startup))]
namespace MyNamespace
public class Startup : FunctionsStartup
public override void Configure(IFunctionsHostBuilder builder)
builder.Services.AddSingleton((s) => {
petmat / app.html
Last active Aug 18, 2017
Aurelia two-way binding problem
View app.html
<require from="./tree"></require>
<h1>The two-way binding problem</h1>
<tree nodes.two-way="fruits"></tree>
<button type="button" click.delegate="changeFruits()">Change fruits</button>
<p repeat.for="message of messages">${message}</p>
petmat / app.html
Last active Oct 20, 2017 — forked from jdanyow/app.html
Aurelia clicking disabled button
View app.html
View manifest.json
"name": "App",
"short_name": "App",
"icons": [{
"src": "images/icons/icon-152x152.png",
"sizes": "152x152",
"type": "image/png"
}, {
"src": "images/icons/icon-192x192.png",
"sizes": "192x192",
View service-worker-fetch.js
self.addEventListener('fetch', function(e) {
console.log('[ServiceWorker] Fetch', e.request.url);
caches.match(e.request).then(function(response) {
return response || fetch(e.request);
View cache-app-shell.js
self.addEventListener('install', function(e) {
console.log('[ServiceWorker] Install');
e.waitUntil( {
console.log('[ServiceWorker] Caching app shell');
return cache.addAll(filesToCache);
View install-service-worker.js
if ('serviceWorker' in navigator) {
.then(function() { console.log('Service Worker Registered'); });
petmat / app.html
Last active May 8, 2017
Aurelia Demo
View app.html
<require from="./contact-list"></require>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="navbar-header">
<a class="navbar-brand" href="#">
<i class="fa fa-user"></i>
<span>Contacts MEYOOW</span>
<span if.bind="1 < 2">I am dog</span>
<span if.bind="1 > 2">I am cat</span>
petmat / app.html
Last active Feb 9, 2017
Aurelia autocomplete with a twist
View app.html
<require from="autocomplete-item"></require>
<div slot="slot1">
You can’t perform that action at this time.