• Stars
    star
    135
  • Rank 267,597 (Top 6 %)
  • Language
    HTML
  • License
    Apache License 2.0
  • Created over 10 years ago
  • Updated about 1 year ago

Reviews

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

Repository Details

interactive programming tutorials, powered by Github and Docker

io.livecode.ch

io.livecode.ch is a prototype for turning code repositories into interactive tutorials and books, with code snippets that can be edited and run on the web.

Test your .io.livecode.ch/_site locally

  • git clone https://github.com/namin/io.livecode.ch
  • cd io.livecode.ch
  • git submodule init; git submodule update
  • cd pub/templates/local
  • git clone https://github.com/<user>/<repo>.git
  • cd ../.. (back to pub directory)
  • python local.py (powered by flask and requests)
  • visit http://localhost:5000/learn/<user>/<repo>
  • if you make code changes, refresh the server installation by visiting http://io.livecode.ch/learn/<user>/<repo>?refresh=1

Development server-side installation steps

These steps have been tested on an Ubuntu derivative and Mac OS X.

  • Install dependencies

    • Install docker for for Ubuntu or for Mac OS X.
    • Install dependencies (example from a clean slate Ubuntu)
      • sudo apt-get install redis-server python-pip git
      • sudo pip install flask redis docker-py
  • Set up local io.livecode.ch repository in a directory of your choice

    • git clone --recursive https://github.com/namin/io.livecode.ch
    • export LIVECODE_DIR=``pwd``/io.livecode.ch
  • Install the io.livecode.ch docker image

    • Get the official image
      • docker pull namin/io.livecode.ch
      • export LIVECODE_CONFIG="dev"
    • Or build your own from the source repo
      • cd $LIVECODE_DIR; docker build -t=namin/io.livecode.ch-dev .
      • export LIVECODE_CONFIG="dev_docker"
  • export GITHUB_BOT_TOKEN="your_access_token"

  • Run local development server

    • export APP_SETTINGS=$LIVECODE_DIR/cfg/$LIVECODE_CONFIG.cfg
    • cd $LIVECODE_DIR/pub
    • python __init__.py

Production server-side installation steps

These steps have been tested on a DigitalOcean (referral link) docker application droplet, and work regardless of the actual (sub)domain name of your server (i.e. no need to change occurrences of io.livecode.ch in config files).

  • Create a new droplet in the DigitalOcean UI:

    • for the image, select the default Ubuntu image
    • for the other options, select as you please. My options:
      • for the size, I use the second smallest droplet, though any other including the smallest should work too.
      • for the last settings, I keep the default VirtIO enabled (I have not tested it disabled).
  • Initial setup of the server

    • Instructions to install Docker
    • $ME refers to your preferred username (e.g. namin for me)
    • $DKR refers to a docker-enabled user (e.g. dkr, which I use for scheduling docker cleanups)
    • as root:
      • be sure to set $ME and $DKR as you like. I do:
        • export ME=namin
        • export DKR=dkr
      • apt-get update
      • apt-get upgrade
      • Install docker.
      • adduser $ME
      • usermod -a -G www-data,docker,sudo $ME
      • usermod -a -G docker www-data
      • adduser $DKR
      • usermod -a -G docker $DKR
    • as $ME:
      • set up your favorite editor (and other tools) as you please. I do:
        • set up emacs
          • sudo apt-get install emacs

          • git clone -b server https://github.com/namin/.emacs.d.git

            (in $HOME directory)

          • run emacs to ensure customization works

        • configure git
          • git config --global user.name "Nada Amin"
          • git config --global user.email "[email protected]"
          • git config --global core.editor emacs
      • pull official io.livecode.ch docker image
        • docker pull namin/io.livecode.ch
      • set up NGINX
        • sudo apt-get install nginx

        • sudo rm /etc/nginx/sites-enabled/default

          (rationale: the default kicks in too easily)

        • (when adding another domain (e.g. dev.livecode.ch), I had to comment out this line in /etc/nginx/nginx.conf: server_names_hash_bucket_size 64;)

      • set up dependencies
        • sudo apt-get install uwsgi uwsgi-plugin-python
        • sudo apt-get install redis-server
        • sudo apt-get install python-pip python-dev
        • sudo pip install flask redis docker-py
      • set up website
        • cd /var
        • sudo mkdir -p www
        • sudo chown www-data:www-data www
        • sudo chmod g+w www
        • cd www
        • git clone https://github.com/namin/io.livecode.ch.git
        • cd io.livecode.ch
        • git submodule init; git submodule update
        • cp app.wsgi.sample app.wsgi
        • edit the app.wsgi to include the environment variable GITHUB_BOT_TOKEN
        • cd cfg
        • sudo cp nginx-site.sample /etc/nginx/sites-available/io.livecode.ch
        • sudo ln -s /etc/nginx/sites-available/io.livecode.ch /etc/nginx/sites-enabled/io.livecode.ch
        • sudo cp uwsgi-app.ini.sample /etc/uwsgi/apps-available/io.livecode.ch.ini
        • sudo ln -s /etc/uwsgi/apps-available/io.livecode.ch.ini /etc/uwsgi/apps-enabled/io.livecode.ch.ini
    • as $DKR:
      • mkdir log
      • touch log/clean.log
      • contrab -e
      • add line
        • */10 * * * * (/var/www/io.livecode.ch/bin/clean) >>log/clean.log

Docker cheat sheet

  • docker run -i -t -u runner -e HOME=/home/runner namin/io.livecode.ch /bin/bash --login

    (shell access)

More Repositories

1

inc

an incremental approach to compiler construction
Scheme
856
star
2

llm-verified-with-monte-carlo-tree-search

LLM verified with Monte Carlo Tree Search
Python
197
star
3

dot

formalization of the Dependent Object Types (DOT) calculus
150
star
4

staged-miniKanren

staged relational interpreters: running with holes, faster
Racket
124
star
5

logically

explorations in core.logic
Clojure
114
star
6

unsound

Artifact for OOPSLA'16 Paper on Unsoundness of Java and Scala
HTML
72
star
7

metaprogramming

Course on Metaprogramming
Scala
56
star
8

pink

Collapsing Towers of Interpreters (in Scheme)
Scheme
52
star
9

propagators

the Art of the Propagator
Scheme
46
star
10

biohacker

debugging biological networks to reach coherence, completeness and consistency
Common Lisp
42
star
11

scalogno

prototyping logic programming in Scala
Scala
39
star
12

metasolfeggio

computer-aided harmony and counterpoint
C
37
star
13

clpsmt-miniKanren

CLP(SMT) on top of miniKanren
Scheme
35
star
14

metamk

Meta-Interpreters in miniKanren
Scheme
31
star
15

play-js-validation

Scala
30
star
16

lms-verify

generative programming & verification
C
30
star
17

lms-black

purple: compiling a reflective language
Scala
26
star
18

leanTAP

A Declarative Theorem Prover for First-Order Classical Logic
Scheme
25
star
19

lambdajam

Workshop on Program Transformations
Scheme
23
star
20

reflection-schemes

exploration of reflective architectures in Scheme
Scheme
20
star
21

lms-sandbox

Graduated to js.scala: JavaScript as an embedded DSL in Scala
Scala
19
star
22

clpset-miniKanren

CLP(Set) in miniKanren
Scheme
18
star
23

grk2clj

From Greek to Clojure, Clojure/conj 2013
TeX
17
star
24

minikanren-confo

core.logic.nominal at the minikanren confo 2013
Clojure
17
star
25

lua

reading and understanding the lua source code
C
16
star
26

dafny-sandbox

Dafny for Metatheory of Programming Languages
Dafny
16
star
27

blond

the reflective tower Blond by Olivier Danvy & Karoline Malmkjær
Scheme
15
star
28

paip

Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp
15
star
29

linkrev

Scala
15
star
30

reflective-towers

software archaeology of reflective towers of interpreters
HTML
14
star
31

mk-on-smt

miniKanren for search, SMT for solving
Scheme
13
star
32

spots

various code snippets in various languages
Scala
13
star
33

rop

reflection-oriented programming
Scheme
13
star
34

3-proto-lisp

Code from the paper Reflection for the Masses by Charlotte Herzeel, Pascal Costanza, and Theo D'Hondt.
Common Lisp
13
star
35

lambda-cube

Scheme
12
star
36

abi

Scheme
10
star
37

higher-rank

Practical type inference for arbitrary-rank types
Haskell
9
star
38

lisp-variations

variations on lisp, exploring reflection
Scala
9
star
39

brown

the reflective language(s) Brown by Dan Friedman and Mitch Wand
Scheme
8
star
40

relaxed-machines

explorations in neuro-symbolic differentiable interpreters
Python
7
star
41

Communication-Bootstrapping-v1

appendix of Jake Beal's master thesis (2002)
Scheme
7
star
42

lambda-calculus

OCaml
7
star
43

steps

open, extensible composition models
Clojure
7
star
44

relational-virology

Synthesis of simple virus-like programs via relational interpreter.
Scheme
7
star
45

feel2

Feeling Wheel 2.0: analyze your mood
TypeScript
6
star
46

refl-instr

reflective architectures that instrument and reify the computation steps
Scheme
6
star
47

sav

Course Project in Synthesis, Analysis and Verification in Scala
Scala
6
star
48

SExp

a prose experiment in learning S-expression manipulations
C#
5
star
49

neoflix-scala

A port of the Neo4j-based Movie Recommender to Scala & Play 2.0
JavaScript
5
star
50

scheme-mechanics

HTML
5
star
51

modmod

A modular module system by Xavier Leroy
OCaml
4
star
52

MusicalBubbles

Java
4
star
53

feel

Feel Wheel: analyze your mood
JavaScript
4
star
54

hallucinations

Original Code for Engineered Robustness by Controlled Hallucination (AAAI 2008) by Beal and Sussman
C
4
star
55

scalding-commoncrawl

Java
4
star
56

lms-regexp

Scala
4
star
57

excel4vivi

Programming Microsoft Excel
C#
3
star
58

.emacs.d

Emacs Lisp
3
star
59

selfopt

prototyping self-optimizing systems
Scheme
3
star
60

wip-scala-virtualized

make scala virtualized great again
2
star
61

ott_distro

Ott
OCaml
2
star
62

implicits-demo

Implicits in Practice (demo at ML Family Workshop 2014)
Scala
1
star
63

micado

Automatically exported from code.google.com/p/micado
C++
1
star
64

coq-sandbox

Coq
1
star
65

scheme2017

Website for Scheme Workshop 2017
TeX
1
star
66

InteractiveScheme

Shell
1
star
67

githubhop

Scala
1
star
68

lms-koika

Scala
1
star
69

playground

nothing to see: just to play with https://io.livecode.ch without breaking a live page
HTML
1
star
70

lms-prob

Scala
1
star
71

world-proverbs

Proverbs from around the world and languages
1
star
72

forest

experiments in diagrams
HTML
1
star
73

io-chatgpt.livecode.ch

a ChatGPT plugin to interact with io.livecode.ch, which can be used as a template to create custom ChatGPT plugins and GPT actions
Python
1
star