Skip to content

Instantly share code, notes, and snippets.

View DEGoodmanWilson's full-sized avatar
🔰
Just getting started.

Don Goodman-Wilson DEGoodmanWilson

🔰
Just getting started.
View GitHub Profile
@DEGoodmanWilson
DEGoodmanWilson / README.md
Created December 11, 2018 14:30
Giphy and GitHub

Goals:

  1. Learn how to set up Probot to create a GitHub App boilerplate
  2. Learn what a GitHub Event is.
  3. Learn how to tell Probot to react to Events by calling external APIs

Let's begin with a warmup. Imagine that we want to greet new visitors to our open source project, by sending them a gif when they open a new issue.

Part 1: Hello World

Begin by making a sandbox repository, to keep everything nice and contained. https://github.com/new

@DEGoodmanWilson
DEGoodmanWilson / Final
Last active November 10, 2018 08:35
Snippets for Craftwork V2
const recastai = require('recastai').default
const GphApiClient = require('giphy-js-sdk-core')
const giphy_client = GphApiClient(process.env.GIPHY_KEY)
module.exports = (app) => {
// Your code here
app.log('Yay! The app was loaded!')
@DEGoodmanWilson
DEGoodmanWilson / index.js
Created August 29, 2018 13:36
Craftwork Recast complete codebase
var recastai = require('recastai').default
module.exports = (app) => {
// Your code here
app.log('Yay! The app was loaded!')
// example of probot responding 'Hello World' to a new issue being opened
app.on('issues.opened', async context => {
app.log(context.payload.issue.title)
@DEGoodmanWilson
DEGoodmanWilson / Step 1.js
Last active August 11, 2019 19:20
Snippets for Craftwork
var recastai = require('recastai').default
swagger: '2.0'
info:
description: A programmatic gateway to securing your app with Sqreen.
version: 'v1'
title: Sqreen API
contact:
name: "Sqreen API Team"
email: "api@sqreen.io"
host: api.sqreen.io
basePath: /v1
require 'grape'
class GoodInterfaceDesign < Grape::API
format :json
params do
requires :name, type: String
end
post '/' do
{:name => params[:name]}
#include <sys/types.h>
#include <microhttpd.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define PORT 8888
#define POSTBUFFERSIZE 512
#define MAXNAMESIZE 20
#define MAXANSWERSIZE 512
https://github.com/slackhq/easy-peasy-bot
git clone git@github.com:slackuserdegoodmanwilson2/easy-peasy-bot.git
npm install --save botkit-middleware-apiai
var apiai = require('botkit-middleware-apiai')({
token: process.env.APIAI_TOKEN
});

Keybase proof

I hereby claim:

  • I am degoodmanwilson on github.
  • I am degoodmanwilson (https://keybase.io/degoodmanwilson) on keybase.
  • I have a public key whose fingerprint is 16AE 4433 11C6 66C8 7FE1 5052 447F 4D71 9FE2 9BC9

To claim this, I am signing this object:

/******
This algorithm, when followed, will generally score between 3,000 and 4,000 points.
How it works:
The inner loop of alternating left-then-down sorts incoming blocks into a gradient, with largest value blocks in the lower left.
After a while, the top-left to bottom-right diagonals need to be collapsed; This is accomplished with the right-then-down.
The timing of the right-then-down could probably be heavily optimized. The outer up-then-down is to avoid a condition where you
can get stuck forever if all the bottom rows are full.
******/
while(1)