Skip to content

Instantly share code, notes, and snippets.

View ggoodman's full-sized avatar

Geoff Goodman ggoodman

View GitHub Profile
@ggoodman
ggoodman / README.md
Created March 26, 2019 18:06
Try Velcro in your browser's dev tools

Check out Velcro for more information.

// Load the runtime
var V={},velcro=(()=>{V.V='Velcro' in window?Promise.resolve(Velcro):new Promise(resolve=>{V.S=document.createElement('script');V.S.src='https://unpkg.com/@velcro/[email protected]';V.S.onload=()=>resolve(Velcro);document.head.appendChild(V.S);});V.R=V.V.then(v=>v.createRuntime());return s=>V.R.then(r=>r.import(s))})();

// Render a simple React element to document.body
var React = await velcro('react'), ReactDOM = await velcro('react-dom'); ReactDOM.render(React.createElement('h1', null, 'Hello Velcro'), document.body);
'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 / README.md
Created August 29, 2014 17:02
Build system and folder structure of Plunker.NEXT

The build system and directory structure for Plunker.NEXT

Tools used:

  • Angular.js
  • ui-router
  • Webpack
  • Less
  • Bower
  • npm
@ggoodman
ggoodman / commander.js
Created April 4, 2014 18:13
Angular commander
var _ = require("lodash");
module.exports =
angular.module("plunker.service.commander", [])
.factory("commander", [ "$q", "$injector", function ($q, $injector) {
var commands = {};
var service = {
addCommand: addCommand,
@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']);
}
});