Skip to content

Instantly share code, notes, and snippets.

@guillegette
guillegette / api.md
Last active April 8, 2024 05:10
Brainner API

API Documentation

Welcome to the Brainner API documentation. This API is primarily focused on managing candidates and jobs within the Brainner platform, providing tools for streamlined operations and efficient management.

As we continuously work on improving and expanding our API's capabilities, this documentation remains a work in progress. It will be regularly updated to reflect the latest changes and enhancements.

To explore our API's functionalities, feel free to use the Swagger Editor at https://editor.swagger.io/. This user-friendly interface allows you to interact with our API, testing its features and capabilities in real-time.

Creating an API Key:

  1. Navigate to the Settings in your Brainner account.
import React, {
forwardRef, useEffect, useImperativeHandle, useState,
} from 'react'
import { useEditor, EditorContent, Editor } from '@tiptap/react';
import Mention from '@tiptap/extension-mention';
import StarterKit from '@tiptap/starter-kit'
import { ReactRenderer } from '@tiptap/react'
import tippy from 'tippy.js'
import { Marked } from 'marked';
import TurndownService from 'turndown';
@guillegette
guillegette / README.md
Created March 8, 2023 11:36
Creating prompts

How to write prompts

A guide on how to write and format your prompts

The basics

When you build the form for your application, each form question has an "Identifier". This is a unique value given to the question so you can later reference it in your prompt. THe identifier can be any string or number of any length, but make sure is unique to the rest of the form questions.

Once you have established your form questions, you can then write your prompt. While you are writing your prompt, you will probably want to incorporate in the text the response that a user give to a specific question. To do this, you simply write {{identifier}}. For example, a prompt to get blog articles for a product: "Return a list of blog post ideas for a product named {{product}}", where "product" is the identifier I gave to the form question.

<html>
<head>
<title>Welcome to Workast</title>
<meta charset="utf-8">
<meta name="description" content="Welcome to Workast">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<link rel="icon" type="image/png" href="https://cdn.workast.io/prod/images/favicon.png">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
@guillegette
guillegette / callback.js
Last active August 3, 2022 06:40
Implementing Slack Oauth 2.0 for www.workat.com
const loginCallback = async (req, res, next) => {
const redirectUri = 'https://...'; // would be the URL defined above
const slackClient = await getSlackOpenIdClient(redirectUri);
const { slackLoginVerifyCode } = req.session;
const tokenSet = await slackClient.callback(
redirectUri,
req.query,
{ code_verifier: slackLoginVerifyCode }
);
// TokenID: Supply
const stickers = {
'1012': 10,
'1013': 11,
'1014': 9,
'1015': 20,
'1016': 15,
'1017': 5,
'1018': 10,
'1019': 17,
@guillegette
guillegette / task_completed.json
Created December 15, 2021 16:33
Outgoing webhooks event sample
{
"id": "61b8e1be1406c410721345d2",
"type": "task_completed",
"createdAt": "2021-12-14T18:26:06.341Z",
"updatePatch": {
"status": "done",
"doneAt": "2021-12-14T18:26:06.304Z",
"doneBy": "4e2a196930fc8294cbc14fc239b012ba",
"removedBy": null,
"removedAt": null
{
"id": "5d372c84d96093007b1e4e0c",
"custom": true,
"name": "Pending Taks",
"payload": {
"sort": [],
"limit": 100,
"expand": [
"createdBy",
"assignedTo",
@guillegette
guillegette / parse-dates.js
Last active May 7, 2017 12:09
Parse dates in natural language for Slack Message Menus
/* Example payload
{
name: 'set_due_date',
value: '',
callback_id: 'new_task_message',
team: { id: 'TXXXXXXXX', domain: 'gette' },
channel: { id: 'CXXXXXXXX', name: 'work' },
user: { id: 'UXXXXXXXX', name: 'guillegette' },
action_ts: '1494154614.757129',
message_ts: '1494138801.457727',
SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3.