Git Product home page Git Product logo

seq-playground's Introduction

Seq Playground

Playground for compiling and running Seq code remotely.

Requirements

Usage

  1. Build Docker image:
    docker build -t seq-playground .
  2. Run Flask app; e.g.
    gunicorn -w 4 -b 157.230.95.210:8000 seq-playground:app
  3. Send a POST request to /seq_exec endpoint; e.g.
    curl -i -X POST -H 'Content-Type: application/json' -d '{"code": "print 2 + 2"}' http://157.230.95.210:8000/seq_exec

JavaScript example

var code = 'print 2 + 2';
$.ajax({
    url: 'http://157.230.95.210:8000/seq_exec',
    dataType: 'text',
    type: 'post',
    contentType: 'application/json',
    data: JSON.stringify({'code': code}),
    processData: false,
    success: function(data, textStatus, jQxhr) {
        // remove error code ANSI colors
        var dataClean =
          data.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '');
        $('#result').html(dataClean);
    },
    error: function(jqXhr, textStatus, errorThrown) {
        $('#result').html('error: could not communicate with execution server');
    }
});

Notes

If you see the following warning from Docker:

WARNING: Your kernel does not support swap limit capabilities
or the cgroup is not mounted. Memory limited without swap.

follow the instructions here to resolve it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.