Skip to content

Instantly share code, notes, and snippets.

View hmhealey's full-sized avatar
😎

Harrison Healey hmhealey

😎
View GitHub Profile
@hmhealey
hmhealey / mm_markdown_differentes.md
Last active November 3, 2022 16:44
A non-exhaustive list of all the ways that MM Markdown differs from CommonMark

Differences between our Markdown and vanilla CommonMark

Description Also part of GFM?
URL autolinking when starting with www. or standard protocols (http, mailto, etc) Yes*
At mentions Yes
Hashtags
Named emojis Yes
Emoticons
@hmhealey
hmhealey / webhook_requests.md
Last active November 9, 2020 20:29
Some useful Mattermost webhook requests for testing and development

Each of these should be followed by a webhook URL

Plain text

curl -X POST -H "content-type: application/json" --data '{"text": "This is a test"}' 

Attachments

curl -X POST -H "content-type: application/json" --data '{"attachments": [{"text": "This is an attached attachment"}]}' 
@hmhealey
hmhealey / generate_assets.go
Created March 25, 2019 14:34
Utility to convert binary files into byte slices in Go
package main
import (
"fmt"
"io/ioutil"
"os"
)
const header = `%s = []byte{%s}
`
@hmhealey
hmhealey / test_http_servers.go
Last active January 25, 2019 13:44
Functions to make httptest servers that serve up different content types
package testutils
import (
"image"
"image/png"
"net/http"
"net/http/httptest"
"strconv"
)
@hmhealey
hmhealey / postgres_config.json
Last active January 13, 2021 22:37
Mattermost config.json snippet to use the development Postgres database
{
"SqlSettings": {
"DriverName": "postgres",
"DataSource": "postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10",
"...": "..."
}
}
#!/usr/bin/env/python
# Run with "python ./slash_command.py"
# http://flask.pocoo.org/docs/0.12/quickstart/
import flask
import json
app = flask.Flask(__name__)
/*******************************************************************************
* SLIDE 2/3/4 *
*******************************************************************************/
import {createSelector} from 'reselect';
const getCurrentUserId = (state) => {
return state.currentUserId;
@hmhealey
hmhealey / rn-cli.config.js
Created October 7, 2016 15:45
rn-cli.config.js to allow for absolute imports in React Native
var path = require('path');
var config = {
getProjectRoots() {
return [
path.resolve(__dirname, '.'),
path.resolve(__dirname, './src')
];
}
};
@hmhealey
hmhealey / pre-commit
Last active June 22, 2023 14:16
Pre-commit style check for JSX and Go
#!/bin/sh
STAGED_JSX_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".[j|t]sx\{0,1\}$" | grep -v node_modules)
STAGED_GO_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".go$" | grep -v vendor)
if [[ "$STAGED_JSX_FILES" != "" ]]; then
PASS=true
echo "\nValidating Javascript:\n"