Skip to content

Instantly share code, notes, and snippets.

@JustMaier
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
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: http://codepen.io/anon/pen/waZOjB -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.4/angular.min.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/JustMaier/6ef7788709d675bd8230/raw/3d39d50e66d8d77e05656ed7dd09298be7e86f1f/ngClickCopy.js"></script>
<script>
angular.module('app', ['ngClickCopy'])
</script>
<div ng-app="app">
<button ng-click-copy="Hello World">Copy</button>
</div>
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
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
angular.extend($resourceProvider.defaults.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>
</div>
<auto:fields fields="field.fields" class="panel-body" data="item" options="field.options" form="item{{$index}}"></auto:fields>
</div>
</div>
@JustMaier
JustMaier / README.md
Created Aug 3, 2016
Select box CSS Reset
View README.md

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

View keybase.md

Keybase proof

I hereby claim:

  • I am justmaier on github.
  • I am justmaier (https://keybase.io/justmaier) on keybase.
  • I have a public key ASDjBkJqr1Bw-Ne71wNeXudl1QfM4eU3sDg641KyWr96AQo

To claim this, I am signing this object: