Home

Awesome

<kbd> <img src="./.github/logo.png" width="1000px"> </kbd>
<div align="center"> <strong><a href="https://polarite.teknologiumum.com">Polarite</a></strong> is a Pastebin alternative made for simplicity written in Go. </div>

Usage

Web Interface

Visit https://polarite.teknologiumum.com

API

Send a POST request to https://polarite.teknologiumum.com with:

Example request:

curl \
    -H "Content-Type: text/plain" \
    -H "Authorization: John Doe <john@example.com>" \
    -X POST \
    -d "Hello World" \
    https://polarite.teknologiumum.com/
fetch("https://polarite.teknologiumum.com/", {
    method: "POST",
    headers: {
        "Content-Type": "text/plain",
        "Authorization": "John Doe <john@example.com>"
    },
    body: "Hello world!"
})
import (
    "net/http"
    "strings"
)

func Polarite() {
    body := strings.NewReader("Hello world")
    req, err := http.NewRequest(http.MethodPost, "https://polarite.teknologiumum.com/", body)
    req.Header.Add("Content-Type", "text/plain")
    req.Header.Add("Authorization", "John Doe <john@example.com>")

    client := &http.Client{}
    resp, err := client.Do(req)
}
using System.Net.Http;

var client = new HttpClient();
var request = new HttpRequestMessage() {
    RequestUri = new Uri("https://polarite.teknologiumum.com/"),
    Method = HttpMethod.Post,
    Headers = {
        { "Authorization", "John Doe <john@example.com>" },
        { "ContentType", "text/plain" }
    },
    Content = new StringContent("Hello world", Encoding.UTF8, "text/plain")
};

var task = await client.SendAsync(request);

Available Options

Polarite uses alecthomas/chroma. You can pass some options to the highlighter by appending these parameters in the URL. If none of these options are passed, you will get a plain text without any highlighting

You can, of course, combine the options. For example: https://polarite.teknologiumum.com/your-unique-id?lang=rust&theme=nord&linenr=true

Why the name, Polarite?

In the dawn of time, it began with the birth of Graphene repository, which its' name was picked from the name of a mineral. Then, not so long after, another repository called Flourite emerged. It's actually a typo of Fluorite, another name of a mineral. Now, where mankind stands, we want to continue that convention, to pick a name from a list of mineral on Wikipedia.

License

   Copyright 2021-present Teknologi Umum <opensource@teknologiumum.com>

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

See LICENSE