Skip to content

Instantly share code, notes, and snippets.

Glenn Block glennblock

Block or report user

Report or block glennblock

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View iopipe-task.js
var logger = require('@iopipe/logger');
var iopipe = require('@iopipe/iopipe')(
{
token: module.webtask.secrets.iopipe,
plugins: [logger({ enabled: true })]
}
);
var handler = iopipe(
(event, context, callback) => {
execute(event, context, callback);
View stripe.js
'use latest';
import express from 'express';
import { fromExpress } from 'webtask-tools';
import bodyParser from 'body-parser';
import stripe from 'stripe';
var app = express();
app.use(bodyParser.urlencoded({ extended: true }));
View stripe-task.js
'use latest';
import express from 'express';
import { fromExpress } from 'webtask-tools';
import bodyParser from 'body-parser';
import stripe from 'stripe';
var app = express();
app.use(bodyParser.urlencoded({ extended: true }));
View gist:34e28dc294a6ad67d31bac62844bbb82
var express = require('express');
var Webtask = require('webtask-tools');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json());
module.exports = Webtask.fromExpress(app);
app.get('/helloworld.html', function(req, res) {
View fslice
var fs = require('fs'), _ = require('underscore');
var source = './Dropbox/Camera Uploads/';
var dest = './picframe/';
var size = 1000;
var files = fs.readdirSync(source);
var sample = _.sample(files, size);
for(i=0;i<size;i++) {
console.log("Copying file: " + (i+1));
fs.copyFileSync(source + sample[i], dest + sample[i]);
}
View zerocrm-middleware
module.exports = createZeroCRMMiddleware;
function createZeroCRMMiddleware() {
return (req, res, next)=> {
const ctx = req.webtaskContext;
const compiler = ctx.compiler;
return compiler.nodejsCompiler(compiler.script, (error, webtaskFn) => {
if (error) return next(error);
View gist:8c573e53fd40d184ac87a417625605ed
const Authz = require('auth0-ext-compilers/lib/authorization');
const Factory = require('auth0-ext-compilers/lib/compilers/compilerFactory');
const Generic = require('auth0-ext-compilers').generic;
module.exports = Factory.createCompiler(zeroCRMHandler);
function zeroCRMHandler(func, ctx, cb) {
Authz.is_authorized(ctx, err => {
if (err) return cb(err);
func.secrets = ctx.secrets;
View gist:eaa3427994acee6ac1b13d9dd5afe049
var express = require('express');
var fromExpress = require('webtask-tools').fromExpress;
var bodyParser = require('body-parser');
var nexmo = require('nexmo');
var app = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.post('/send', (req,res) => {
var ctx = req.webtaskContext;
View gist:8d3e09903061fb9de16116ca673716a9
Build FAILED.
"/Users/glennblock/src/graphql-dotnet/src/GraphQL.sln" (default target) (1) ->
"/Users/glennblock/src/graphql-dotnet/src/GraphQL.GraphiQL/GraphQL.GraphiQL.csproj.metaproj" (default target) (2) ->
"/Users/glennblock/src/graphql-dotnet/src/GraphQL.GraphiQL/GraphQL.GraphiQL.csproj" (default target) (4) ->
(ResolveAssemblyReferences target) ->
/Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2001,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "GraphQL.StarWars". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/Users/glennblock/src/graphql-dotnet/src/GraphQL.GraphiQL/GraphQL.GraphiQL.csproj]
/Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2001,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Web.Entity". Ch
You can’t perform that action at this time.