• Stars
    star
    221
  • Rank 179,773 (Top 4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 3 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

paste is a simple web app for writing & sharing code.

paste is a simple web app for writing & sharing code. It's my own take on conventional pastebin sites like pastebin.com or hastebin.

Anyone can use paste! The official/public instance can be accessed using the endpoints listed below, but you can also host your own if you like!

1) In a Web Browser

Just go to https://pastes.dev!

2) From the Command Line

You can submit content most easily using curl.

# Upload the contents of a file
> curl -T example.txt https://api.pastes.dev/post

# Upload the contents of a file and specify the language
> curl -T example.yml -H "Content-Type: text/yaml" https://api.pastes.dev/post

# Pipe in some output from any command
> echo "Hello world" | curl -T - https://api.pastes.dev/post
If curl isn't installed on your system, you can also post using netcat.
# Pipe in some output from any command
> echo "Hello world" | nc nc.pastes.dev 1337

# Upload the contents of a file
> cat example.txt | nc nc.pastes.dev 1337
If you don't want to do so much typing, you can create a shorter alias.
# Add this to the end of `~/.bashrc` and run 'source ~/.bashrc'
paste() {
  curl -T $1 https://api.pastes.dev/post
}

then...

# Upload the contents of a file
> paste example.txt

# Pipe in some output from any command
> echo "Hello!" | paste -
3) From Code

Send GET/POST/PUT requests to https://api.pastes.dev/. More info below.


About

The frontend (this repository) is written using the React framework. The backend data storage is handled by a separate web service called bytebin.

The user-interface is based on the Monaco Editor, the engine behind the popular Visual Studio Code text editor. It's quite simple; it supports syntax highlighting, automatic indentation, many supported languages, themes, zooming in/out, linking to specific lines or sections, and more!

pastes.dev

I host a public instance at https://pastes.dev. Please feel free to use it to share code/configs/whatever!

Please note that the following (very-non-legally worded) terms of service apply.
If you come across any content which is illegal or infringes on copyright, please get in touch and let me know so I can remove it.

Uploaded content is retained for 90 days then deleted.

pastes.dev API

  • To read content, send a HTTP GET request to https://api.pastes.dev/<key>.
    • Replace <key> with the id of the paste.
    • The content is returned in the response body.
    • The Content-Type header is text/<language>, where language is the id of the language the paste was saved with.
  • To upload content, send a HTTP POST request to https://api.pastes.dev/post.
    • Include the content in the request body.
    • Specify the language with the Content-Type: text/<language> header, and please provide a User-Agent header too.
    • The paste "key" is returned in the Location header, or in the response body as a JSON object in the format {"key": "<key>"}.

The API is powered by the bytebin service, so more information about how it works can be found there.


Host your own

It's quite simple to host your own version.

git clone https://github.com/lucko/paste
cd paste
yarn install

# Outputs html/css/js files to /build
yarn build

# Start a webserver for testing/development
yarn start

You can then follow the create-react-app deployment documentation for how to host the build output. I personally recommend deploying to the cloud using a service like Netlify instead of hosting on your own webserver.

If you really want to self-host (including the bytebin data storage part), I suggest using Docker:

git clone https://github.com/lucko/paste
docker compose up -d

You should then (hopefully!) be able to access the application at http://localhost:8080/.

More Repositories

1

spark

A performance profiler for Minecraft clients, servers, and proxies.
Java
1,027
star
2

helper

A collection of utilities and extended APIs to support the rapid and easy development of Bukkit plugins.
Java
456
star
3

BungeeGuard

A plugin-based security/firewall solution for BungeeCord and Velocity proxies.
Java
211
star
4

commodore

Utility for using Minecraft's 1.13 'brigadier' library in Bukkit plugins.
Java
177
star
5

bytebin

Fast & lightweight content storage web service.
Java
102
star
6

jar-relocator

A Java program to relocate classes within a jar archive using ASM.
Java
90
star
7

spark-viewer

Web frontend for spark.
TypeScript
77
star
8

fabric-permissions-api

A simple permissions API for Fabric
Java
52
star
9

minecraft-command-permissions-fabric

Registers vanilla Minecraft commands in Fabric Permission API with structure "minecraft.command.<command>"
Java
45
star
10

shadow

An annotation based API for Java reflection.
Java
26
star
11

bytesocks

Fast & lightweight WebSocket server with channels.
Java
21
star
12

infra

Config for the self-hosted infrastructure and services used by my open source projects
Roff
19
star
13

VaultChatFormatter

Java
16
star
14

shadow-bukkit

Extra annotations for use with shadow and Bukkit
Java
13
star
15

ScriptController

Extended API for Java's Scripting Engine framework
Java
12
star
16

gChat

A simple global chat plugin for BungeeCord.
Java
11
star
17

TinyVault

A minimal Vault plugin
Java
11
star
18

tapir

Java
10
star
19

commodore-file

The commodore file format
Java
7
star
20

LuckPermsUI

Desktop client for LuckPerms.
Java
7
star
21

paste-netcat

Upload content to pastes.dev using netcat
Go
6
star
22

synapse

Java
5
star
23

spark2json

Convert raw spark profiler data to JSON
JavaScript
5
star
24

bytesocks-java-client

A Java client for bytesocks
Java
5
star
25

spark-docs

Documentation for spark.
TypeScript
5
star
26

configurate-toml

Java
5
star
27

spark-mappings

Deobfuscation mappings data for spark-web
JavaScript
4
star
28

ConditionalPerms

Define permissions that only apply when conditions are met
Java
4
star
29

FindLag

Java
3
star
30

adventure-platform

Java
3
star
31

adventure

Java
3
star
32

SidebarManager

A simple scoreboard manager
Java
2
star
33

LogUploader

Java
2
star
34

NetworkAnalytics

Java
2
star
35

PunishmentGui

GUI based punishments with automatically scaled responses
Java
2
star
36

lucko.github.io

Personal website
JavaScript
2
star
37

servercmd

Adds /server on the backend server
Java
1
star
38

helper-dev

Misc utilities to aid with Minecraft in-game content design
Java
1
star
39

WelcomeTutorial

Java
1
star
40

synapse-plugins

Java
1
star
41

CommandBlocker

Java
1
star
42

mod-publish

Some handy scripts to automatically publish of some of my Minecraft mods to CurseForge and Modrinth
TypeScript
1
star
43

spark-infopoints

spark info points are extra snippets of information about well-known/notable call frames
JavaScript
1
star