This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create an image based on this existing ruby image | |
FROM ruby:2.4.1 | |
# Install the software you need | |
RUN apt-get update \ | |
&& apt-get install -y \ | |
apt-utils \ | |
build-essential \ | |
libpq-dev \ | |
libjpeg-dev \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set docker-compose version | |
version: '3' | |
services: | |
postgres: | |
container_name: postgres | |
ports: | |
- "5432:5432" | |
volumes: | |
- $HOME/postgres-data:/var/lib/postgresql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"text": "Hello! What subject would you like to learn more about?", | |
"fallback": "Upgrade your Slack client to use messages like these.", | |
"color": "#3AA3E3", | |
"attachment_type": "default", | |
"callback_id": "subjects", | |
"actions": [ | |
{ | |
"name": "subject_list", | |
"text": "Select one", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { createEventAdapter } = require('@slack/events-api') | |
const slackSigningSecret = process.env.SLACK_SIGNING_SECRET | |
const slackEvents = createEventAdapter(slackSigningSecret) | |
const { WebClient } = require('@slack/web-api') | |
const token = process.env.SLACK_BOT_TOKEN | |
const web = new WebClient(token) | |
const subjects = require('./elements/subjects.json') | |
function listenForEvents(app) { | |
app.use('/events', slackEvents.requestListener()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { createEventAdapter } = require('@slack/events-api') | |
const slackSigningSecret = process.env.SLACK_SIGNING_SECRET | |
const slackEvents = createEventAdapter(slackSigningSecret) | |
function listenForEvents(app) { | |
app.use('/events', slackEvents.requestListener()) | |
} | |
slackEvents.on('app_mention', (event) => { | |
console.log(`Received an app_mention event from user ${event.user} in channel ${event.channel}`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (process.env.NODE_ENV !== "production") | |
{ | |
require("dotenv").config() | |
} | |
const express = require('express') | |
const port = process.env.PORT | |
const app = express() | |
app.listen(port, function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/node_modules | |
npm-debug.log | |
.DS_Store | |
/*.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { createMessageAdapter } = require('@slack/interactive-messages') | |
const slackSigningSecret = process.env.SLACK_SIGNING_SECRET | |
const slackInteractions = createMessageAdapter(slackSigningSecret) | |
const articleOrBookButton = require('./elements/articleOrBookButton.json') | |
module.exports.listenForInteractions = function (app) { | |
app.use('/interactions', slackInteractions.requestListener()) | |
} | |
slackInteractions.action({ type: 'select' }, (payload, respond) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "Here is an <https://witanddelight.com/2020/05/how-white-people-can-be-better-allies-to-the-black-community/|article>: ow how white people can be better allies to the black community :rolled_up_newspaper: :fist:" | |
} | |
} | |
] |
OlderNewer