Skip to content

Instantly share code, notes, and snippets.

View definitelynotsoftware's full-sized avatar

Dan Bergman definitelynotsoftware

  • definitivesoftware
  • Massachusetts
View GitHub Profile
@definitelynotsoftware
definitelynotsoftware / app.router.config.js (Aurelia - simple role-based navigation using 'aurelia-authentication')
Last active March 22, 2019 05:12
Aurelia - simple role-based navigation using 'aurelia-authentication'
import {AuthenticateStep} from 'aurelia-authentication';
import {inject} from 'aurelia-framework';
import {Router} from 'aurelia-router';
import {Session} from 'services/session';
import * as log from 'toastr';
@inject(Router)
export default class {
constructor(router) {
@paulczy
paulczy / ETagAttribute.cs
Last active April 26, 2018 15:32
Add ETags to your ASP.NET Core responses.
using System;
using System.IO;
using System.Security.Cryptography;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Newtonsoft.Json;
using Newtonsoft.Json.Bson;
// ReSharper disable once CheckNamespace
@jdanyow
jdanyow / app.html
Last active February 19, 2019 21:14
Aurelia Accessible Autocomplete with Filtering
<template>
<require from="./autocomplete"></require>
<form>
<label class="form-component">
Country:<br/>
<autocomplete service.bind="suggestionService.country"
value.bind="model.country"
placeholder="Enter country..."
change.delegate="model.city = null">
</autocomplete>
@Scapal
Scapal / calendar.js
Last active June 18, 2019 08:08
Aurelia FullCalendar integration
import {
inject, noView, bindable, bindingMode,
customElement, BindingEngine, inlineView
} from 'aurelia-framework';
import 'jquery';
import moment from 'moment';
import {fullCalendar} from 'fullcalendar';
@customElement('calendar')
@chantastic
chantastic / on-jsx.markdown
Last active November 10, 2024 13:39
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@bradwilson
bradwilson / gist:2417226
Created April 18, 2012 22:55
Ninject dependency resolver for Web API
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Web.Http.Dependencies;
using Ninject;
using Ninject.Syntax;
public class NinjectDependencyScope : IDependencyScope
{
private IResolutionRoot resolver;