Skip to content

Instantly share code, notes, and snippets.

View jussimattila's full-sized avatar

Jussi Mattila jussimattila

  • Combinostics
  • Finland
View GitHub Profile
@jussimattila
jussimattila / Issue status badges
Created January 28, 2015 08:25
Copy-pasteable status badges for GitHub issues
[wip]: https://raw.githubusercontent.com/combinostics/img/master/kanban/wip.jpg "In progress"
[ready]: https://raw.githubusercontent.com/combinostics/img/master/kanban/ready.jpg "Ready"
[rejected]: https://raw.githubusercontent.com/combinostics/img/master/kanban/rejected.jpg "Rejected"
[accepted]: https://raw.githubusercontent.com/combinostics/img/master/kanban/verified.jpg "Accepted"
<!--- Usage:
![alt text][wip]
![alt text][ready]
![alt text][rejected]
![alt text][accepted]
@jussimattila
jussimattila / checkout.js
Created August 11, 2015 11:28
Aurelia Stripe checkout
import stripeCheckout from 'stripe-checkout';
export class StripeCheckout {
private stripeHandler = stripeCheckout.configure({ key: '...', name: '...', zipCode: true });
popup(email, productDescription, priceInCents, confirmButtonText) {
return new Promise((resolve, reject) => {
this.stripeHandler.open({
description: productDescription,
amount: priceInCents,
panelLabel: confirmButtonText,
token: token => resolve(token),
@jussimattila
jussimattila / UploadModule.cs
Last active November 2, 2016 00:16
File upload with NancyFX
namespace NancyUpload
{
using System;
using System.IO;
using System.Linq;
using Nancy;
public class UploadModule : NancyModule
{
public UploadModule(): base()
@jussimattila
jussimattila / app.html
Last active March 21, 2016 23:21
Aurelia Plunker v0.10.1
<template>
<require from="./repeater"></require>
<h3>Remove the first repeater (0), alert should show 'Detached content 0' but shows 'Detached content 1'.</h3>
<div>
To fix the issue, open repeater.js, and uncomment 'detached() {}'.
</div>
<br>
<div repeat.for="repeaterId of repeaterIds">
<repeater repeater-id.bind="repeaterId"></repeater>
<button click.trigger="$parent.removeRepeaterId(repeaterId)">Remove me</button>
@jussimattila
jussimattila / description.md
Last active April 10, 2017 12:58
Algorithm output file names

Consolidate output file names from MRI processing

File format: [base output]_[main input]_[algorithm acronym]_[type(optional)].[extension]

Only the primary outputs are written to disk, unless an argument --output-all is provided.

Algorithm main input acronym type extension primary
N4 bias correction t1 n4 .nii.gz
@jussimattila
jussimattila / CreateServiceBus.cs
Last active April 5, 2019 07:09
Code snippets showing the initialization of MassTransit locally (RabbitMQ) or in the cloud (Azure Service Bus) based on configuration
// IComponentContext from Autofac, using DI container to create message consumers
public static IBusControl Create(IComponentContext componentContext)
{
var serviceBusConfiguration = GetServiceBusConfiguration();
var serviceBus = CreateServiceBus(serviceBusConfiguration, componentContext);
await serviceBus.StartAsync();
return serviceBus;
}
using System;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;