All Projects → dsnet → playground

dsnet / playground

Licence: BSD-3-Clause License
Locally hosted Go playground for more advanced functionality.

Programming Languages

go
31211 projects - #10 most used programming language
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to playground

extkeras
Playground for implementing custom layers and other components compatible with keras, with the purpose to learn the framework better and perhaps in future offer some utils for others.
Stars: ✭ 18 (+20%)
Mutual labels:  playground
try-manubot
A repository to practice contributing to a Manubot manuscript
Stars: ✭ 35 (+133.33%)
Mutual labels:  playground
tokonoma
Graphics related projects/prototypes/playground (Vulkan, C++17)
Stars: ✭ 23 (+53.33%)
Mutual labels:  playground
grafonnet-playground
Playground for grafanna with jsonnet
Stars: ✭ 25 (+66.67%)
Mutual labels:  playground
vue-code-view
A Vue 2 component like Vue SFC REPL `@vue/repl` : u can edit, run and preview the code effect display in real time on the web page.
Stars: ✭ 67 (+346.67%)
Mutual labels:  playground
web-dojo
A dojo for JavaScript and more.
Stars: ✭ 20 (+33.33%)
Mutual labels:  playground
A-World-of-Circles
WWDC 2017 Scholarship Recipient. A Swift Playgrounds Book that visually teaches the relationship between sines and circles.
Stars: ✭ 24 (+60%)
Mutual labels:  playground
substrate-playground
Start hacking your substrate runtime in a web based VSCode like IDE
Stars: ✭ 68 (+353.33%)
Mutual labels:  playground
schema.tl
📜 Easy-to-use TL-Schema viewer
Stars: ✭ 55 (+266.67%)
Mutual labels:  playground
react-playground
Xcode Playground but React.
Stars: ✭ 26 (+73.33%)
Mutual labels:  playground
goplay
The Go Playground (https://play.golang.org/) client
Stars: ✭ 75 (+400%)
Mutual labels:  playground
playground
ReScript playground
Stars: ✭ 25 (+66.67%)
Mutual labels:  playground
aik
Frontend Playground
Stars: ✭ 43 (+186.67%)
Mutual labels:  playground
APNsKit
A framework to send Apple Notifications
Stars: ✭ 20 (+33.33%)
Mutual labels:  playground
To-The-Apples-Core
⚙️ A collection of non-jailbroken code snippets on reverse-engineered iOS private apis
Stars: ✭ 69 (+360%)
Mutual labels:  playground
jscore-playground
JavaScriptCore example for Swift Playgrounds
Stars: ✭ 17 (+13.33%)
Mutual labels:  playground
ML-Playground
A Playground for machine learning techniques
Stars: ✭ 97 (+546.67%)
Mutual labels:  playground
mnist-coreml
Simple convolutional neural network to predict handwritten digits using Keras + CoreML for WWDC '18 scholarship [Accepted]
Stars: ✭ 45 (+200%)
Mutual labels:  playground
Paperville
🏙 Design a city in Swift code (WWDC 2018 submission, ACCEPTED)
Stars: ✭ 48 (+220%)
Mutual labels:  playground
airboardgame
AirBoardGame is a virtual tabletop to play and create any boardgame online with your friends
Stars: ✭ 45 (+200%)
Mutual labels:  playground

Local Go Playground

Introduction

Playground is a web application that executes arbitrary Go code locally. This tool provides the ability to save and load various code snippets, the ability to run Go code using arbitrary third-party packages, and the ability to run tests and benchmarks.

screenshot

Since the Playground executes arbitrary Go code on the server it is running from, there are obvious security implications. As a baseline, the Playground requires a password in order use the service. However, anyone using this is responsible for adding extra layers of security themselves:

  • Consider running playground from a Linux Container or from a dedicated VM to sandbox the process.
  • Consider using a web server (like Caddy) to provide automatic HTTPS and another layer of authentication.

Running the server is only supported on Linux and OSX.

Basic Usage

Build the server:

go get -u github.com/dsnet/playground

Start the server (assuming $GOPATH/bin is in your $PATH):

$ playground
Enter a new Playground login password: ...
2017/05/11 18:07:07 main.go:184: loaded config:
{
	"ServeAddress": "localhost:8080",
	"PasswordSalt": "c9c8959441f5a49e0fed99a9a0704ef0725786b318304088fee0b9b1299a68f3",
	"PasswordHash": "ec3c17aba3fa603bc443e82b748db059bf294d9d3d9f975e15e9598241671af7",
	"DataPath": "/home/rawr/.playground",
	"GoBinary": "go",
	"FmtBinary": "goimports",
	"BinaryVersion": "Git+7ed13d2, Fri May 12 00:35:19 2017",
	"BinarySHA256": "c026207e6ff152e4f5b7be4a098577f164fed983650389a971a205384f5829aa"
}
2017/05/11 18:07:07 main.go:254: playground starting on localhost:8080
...

When running playground without a configuration file, it requires a password to be supplied. The Playground can be interacted with by visiting http://localhost:8080 in a browser.

The Playground executes arbitrary snippets of Go code. Each code snippet is an individual Go program and will be executed as either an executable or a test suite. The presence of a main function or any Test or Benchmark functions determine what type of program it is. These functions cannot be mixed; that is, only one type or the other may exist within the snippet. Lastly, all snippets must be within the main package.

Advanced Usage

Typically, playground is started as a background service; in which case, a configuration file should be provided. An example configuration file is:

{
	"ServeAddress": "localhost:8080",
	"LogFile": "daemon.log",
	"PasswordSalt": "ed1b3112286780279e740612b0a03f2c0d1550d5e7d2197c636b5d3eb6ee51b2",
	"PasswordHash": "4ef6b693629568e78ad0846ee189c8e9fdf719fbe631650ad547192d9c3490ba",
	"DataPath": "/usr/local/playground",
	"GoBinary": "go",
	"FmtBinary": "goimports",
	"Environment": {
		"PATH": "/usr/local/bin:/usr/bin:/bin",
		"GOPATH": "/path/to/gopath",
	},
}

The password fields consists of a randomly generated salt and a hashed version of the actual password. This pair of values can be generated with the following shell script:

#!/bin/bash
read -s -p "Password: " PASSWORD && echo
PASSWORD_SALT=$(head -c 1024 /dev/urandom | sha256sum | head -c 64)
PASSWORD_HASH=$(echo -n "$(echo $PASSWORD_SALT | xxd -r -p)${PASSWORD}" | sha256sum | head -c 64)
echo -en "PasswordSalt: $PASSWORD_SALT\nPasswordHash: $PASSWORD_HASH\n"
unset PASSWORD PASSWORD_SALT PASSWORD_HASH

See the Help in main.go for more details about configuration options.

See the Help in web interface for more details about using the Playground.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].