Skip to content

Instantly share code, notes, and snippets.

JustMaier / Helpers_SimpleAuthorizationServerProvider.cs
Last active Jul 13, 2016
Simple Bearer Auth using OWIN Authentication
View Helpers_SimpleAuthorizationServerProvider.cs
using EventTracker.Models;
using Microsoft.Owin.Security.OAuth;
using System.Security.Claims;
using System.Threading.Tasks;
using System.Linq;
namespace EventTracker.Helpers {
public class SimpleAuthorizationServerProvider : OAuthAuthorizationServerProvider {
public override async Task ValidateClientAuthentication(OAuthValidateClientAuthenticationContext context) {
// OAuth2 supports the notion of client authentication
JustMaier / demo.html
Last active Jun 25, 2020
Simple copy to clipboard functionality in angular without any dependencies
View demo.html
<!-- View it live here: -->
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
angular.module('app', ['ngClickCopy'])
<div ng-app="app">
<button ng-click-copy="Hello World">Copy</button>
View cratejoy-sample.js
var _ = require('lodash');
var cratejoyAPI = require('node-cratejoy');
var cratejoy = new cratejoyAPI('{API Id Here}', '{API Key Here}');
var fs = require('fs');
// var now = new Date();
// var msPerHr = 60 * 60 * 1000;
// var twoHoursAgo = new Date(now - 2 * msPerHr);
//Get all subscriptions
JustMaier / example.js
Last active Apr 22, 2016
Handle 201 in angular $resource - Get Id
View example.js
// Config the $resourceProvider
app.config(["$resourceProvider",function ($resourceProvider) {
// extend the default actions
save : {
method : "POST",
interceptor: {
response: function(response){
if(response.status == 201){
View angular-repeater.html
<div class="autofields-repeater">
<div ui-sortable="sortableOptions" ng-model="ngModel">
<div class="autofields-repeater-container panel panel-default" ng-repeat="item in ngModel">
<div class="panel-heading">
<h4 class="panel-title" ng-bind="field.title"></h4>
<button type="button" class="close" title="Remove" ng-click="removeItem(item, $index)">&times;</button>
<auto:fields fields="field.fields" class="panel-body" data="item" options="field.options" form="item{{$index}}"></auto:fields>
JustMaier /
Created Aug 3, 2016
Select box CSS Reset

Safari has some annoying default styling for select boxes. This will reset it to a respectable default.

Note: This was created with Bootstrap in mind, but it can easily be modified to work with anything you like


Keybase proof

I hereby claim:

  • I am justmaier on github.
  • I am justmaier ( on keybase.
  • I have a public key ASDjBkJqr1Bw-Ne71wNeXudl1QfM4eU3sDg641KyWr96AQo

To claim this, I am signing this object: