Skip to content

Instantly share code, notes, and snippets.

View ggoodman's full-sized avatar

Geoff Goodman ggoodman

View GitHub Profile
'use strict';
const Assert = require('assert');
Assert.ok(module.webtask.secrets['jwt-scope'], 'The jwt-scope secret is required for the jwt-authz');
module.exports = () => {
const requiredScopes = module.webtask.secrets['jwt-scope'].split(/\s+/);
return function middleware(req, res, next) {
@ggoodman
ggoodman / README.md
Created February 11, 2015 15:25
Use bluebird.js with angular.js as a replacement for $q
@ggoodman
ggoodman / create.request.json
Created February 3, 2012 13:59
Plunker API request/response examples
{
"description": "Optional description of the plunk", // Optional
"index": "index.html", // Optional (if provided must have a corresponding file entry, otherwise must provide index.html)
"files": { // Required
// Inline format below for defining files (filename => content)
"index.html": "<html><head><link rel="stylesheet" href="style/style.css" /><script src="https://raw.github.com/JerrySievert/cromagjs/master/cromag.js"></script></head><body><h1>Header</h1></body><p>If the header above is red, that means that both this file (index.html) and the stylesheet (style.css) were property served by plunker.</p></html>",
// Complete format below for defining files (filename => file description)
"style/style.css": {
"mime": "text/css", // Optional (will be guessed otherwise based on filename)
"encoding": "utf-8", // Optional (will be guessed otherwise based on mime type)
@ggoodman
ggoodman / app.js
Last active May 2, 2016 18:06 — forked from ggoodman/app.js
AngularJS unstable template
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope) {
$scope.name = 'World';
});
@ggoodman
ggoodman / README.md
Created October 11, 2013 22:27
Angular.js stop-propagation directive

Stop event propagation in Angular.js

This directive allows you to stop propagation for any event supplied.

Lets say you have an ng-click handler on a button that is overlayed on top of an <a href></a> link. You cant your click handler to fire, but not the anchor tag's default action. What you need is to stop the propagation of the click event up to the anchor tag.

Usage

@ggoodman
ggoodman / format.js
Created May 23, 2013 21:33
Importer format
{
source: "http://whatever",
description: "Blah blah",
tags: [],
files: {
"index.html": {
filename: "index.html",
content: "<html>..."
},
...
@ggoodman
ggoodman / app.js
Last active December 15, 2015 18:09 — forked from evangalen/app.js
Angular + Jasmine
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope) {
$scope.name = 'World';
});
@ggoodman
ggoodman / index.html
Created March 31, 2013 18:17
Basic Plunk
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Plunker</title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
@ggoodman
ggoodman / app.js
Last active December 15, 2015 05:09
Ember Starter Kit
App = Ember.Application.create({});
App.IndexRoute = Ember.Route.extend({
setupController: function(controller) {
controller.set('content', ['a', 'b', 'c']);
}
});
@ggoodman
ggoodman / components.json
Created October 29, 2012 22:14
component.json scraped from Bower repository
{
"yepnope": {
"name": "yepnope",
"version": "1.5.4",
"main": "./yepnope.1.5.4-min.js"
},
"stitch-css": {
"name": "stitch-css",
"version": "0.1.7",
"main": "./stylesheets/_stitch.scss"