Skip to content

Instantly share code, notes, and snippets.

Craig Shoemaker craigshoemaker

Block or report user

Report or block craigshoemaker

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
@craigshoemaker
craigshoemaker / learn-bindings-index.js
Created Nov 2, 2018
Updated implementation for Functions Learn Module on Functions triggers and bindings
View learn-bindings-index.js
module.exports = function (context, req) {
var response = {
status: 200,
headers: { "Content-Type": "application-json" }
};
if (req.query.id || req.body && req.body.id) {
var bookmark = context.bindings.bookmark;
@craigshoemaker
craigshoemaker / addTopicToStream.js
Created Dec 6, 2016
Using search-index with Gulp.js
View addTopicToStream.js
const through = require('through2');
const uuidV4 = require('uuid/v4');
module.exports = () => {
return through.obj(function (file, encoding, next) {
this.push({
id: uuidV4(),
body: file.contents.toString(encoding)
});
@craigshoemaker
craigshoemaker / search-index-test.js
Last active Nov 23, 2016
Proof of concept working with search-index
View search-index-test.js
const si = require('search-index');
const stream = require('stream');
const topics = [
`Title for File 1 \n A long time ago, in a galaxy far far way...`,
`Title for File 2 \n Once upon a time there was a beautiful princess...`,
`Title for File 3 \n It was the best of times, it was the worst of times...`,
`Title for File 4 \n There once was a Prince and a frog...`,
`Title for File 5 \n In a galaxy with princes, princesses, frogs and times, we at chocolate.`
];
@craigshoemaker
craigshoemaker / angular-doc-controller
Created Jul 2, 2014
Controller Definition from Official AngularJS Help Documentation
View angular-doc-controller
// from: https://docs.angularjs.org/guide/controller
myApp.controller('GreetingController', ['$scope', function($scope) {
$scope.greeting = 'Hola!';
}]);
@craigshoemaker
craigshoemaker / structuring-angular-injectors
Created Jul 2, 2014
Structuring AngularJS Code: Injecting with Whitespace
View structuring-angular-injectors
(function () {
'use strict';
angular.module('app').controller('editController',
['$scope', '$location',
function ($scope, $location) {
// get crazy with your controller here ;)
You can’t perform that action at this time.