18 |
19 |
20 |
21 | );
22 | }
23 |
--------------------------------------------------------------------------------
/backup/home-full-duplex/sur/todomvc.hoon:
--------------------------------------------------------------------------------
1 | ::
2 | :: todoMVC sur file
3 | ::
4 | |%
5 | :: Available poke actions follow
6 | ::
7 | +$ action
8 | $%
9 | :: This is just a test action to show the functionality.
10 | :: It lets us change the message stored in our app's state, by providing a new message (msg).
11 | ::
12 | [%test-action msg=tape]
13 | [%list-tasks completed=?]
14 | [%pull-task id=@ud]
15 | [%add-task task=@tU]
16 | [%remove-task id=@ud]
17 | [%mark-complete id=@ud]
18 | [%send-tasks =path]
19 | [%update-tasks =(list [task=@tU complete=? id=@ud])]
20 | ==
21 | ::
22 | :: We're adding a type here to handle a map of tasks
23 | ::
24 | +$ tasks (map id=@ud [task=@tU complete=?])
25 | --
--------------------------------------------------------------------------------
/backup/src-lesson1/mar/tudumvc/action.hoon:
--------------------------------------------------------------------------------
1 | ::
2 | :: tudumvc mar file
3 | ::
4 | /- tudumvc
5 | =, dejs:format
6 | |_ act=action:tudumvc
7 | ++ grab
8 | |%
9 | ++ noun action:tudumvc
10 | ++ json
11 | |= jon=^json
12 | %- action:tudumvc
13 | =<
14 | (action jon)
15 | |%
16 | ++ action
17 | %- of
18 | :~ [%update-tasks task-update]
19 | [%add-task so]
20 | [%remove-task ni]
21 | [%mark-complete ni]
22 | [%edit-task (ot :~(['id' ni] ['label' so]))]
23 | ==
24 | ++ task-update
25 | %- ar
26 | %- ot
27 | :~ :- %done bo
28 | :- %id ni
29 | :- %label so
30 | ==
31 | --
32 | --
33 | --
--------------------------------------------------------------------------------
/backup/home-full-duplex/app/todomvc/basic/js/app.js:
--------------------------------------------------------------------------------
1 | /*global app, $on */
2 | (function () {
3 | 'use strict';
4 |
5 | /**
6 | * Sets up a brand new Todo list.
7 | *
8 | * @param {string} name The name of your new to do list.
9 | */
10 | function Todo(name) {
11 | this.storage = new app.Store(name);
12 | this.model = new app.Model(this.storage);
13 | this.template = new app.Template();
14 | this.view = new app.View(this.template);
15 | this.controller = new app.Controller(this.model, this.view);
16 | }
17 |
18 | var todo = new Todo('todos-vanillajs');
19 |
20 | function setView() {
21 | todo.controller.setView(document.location.hash);
22 | }
23 | $on(window, 'load', setView);
24 | $on(window, 'hashchange', setView);
25 | })();
--------------------------------------------------------------------------------
/backup/home-react-full/mar/todoreact/action.hoon:
--------------------------------------------------------------------------------
1 | ::
2 | :: todoMVC mar file
3 | ::
4 | /- todoreact
5 | =, dejs:format
6 | |_ act=action:todoreact
7 | ++ grab
8 | |%
9 | ++ noun action:todoreact
10 | ++ json
11 | |= jon=^json
12 | %- action:todoreact
13 | =<
14 | (action jon)
15 | |%
16 | ++ action
17 | %- of
18 | :~ [%update-tasks task-update]
19 | [%add-task so]
20 | [%remove-task ni]
21 | [%mark-complete ni]
22 | [%edit-task (ot :~(['id' ni] ['label' so]))]
23 | ==
24 | ++ task-update
25 | %- ar
26 | %- ot
27 | :~ :- %done bo
28 | :- %id ni
29 | :- %label so
30 | ==
31 | --
32 | --
33 | --
--------------------------------------------------------------------------------
/src-lesson6/home (part II)/mar/tudumvc/frontend.hoon:
--------------------------------------------------------------------------------
1 | ::
2 | :: tudumvc-frontend mar file
3 | ::
4 | /- tudumvc
5 | =, dejs:format
6 | |_ front=frontend:tudumvc
7 | ++ grad %noun
8 | ++ grow
9 | |%
10 | ++ noun front
11 | --
12 | ++ grab
13 | |%
14 | ++ noun frontend:tudumvc
15 | ++ json
16 | |= jon=^json
17 | %- frontend:tudumvc
18 | =<
19 | (front-end jon)
20 | |%
21 | ++ front-end
22 | %- of
23 | :~ [%add-task (ot :~(['ship' (se %p)] ['label' so]))]
24 | [%remove-task (ot :~(['ship' (se %p)] ['id' ni]))]
25 | [%mark-complete (ot :~(['ship' (se %p)] ['id' ni]))]
26 | [%edit-task (ot :~(['ship' (se %p)] ['id' ni] ['label' so]))]
27 | ==
28 | --
29 | --
30 | --
--------------------------------------------------------------------------------
/src-lesson3/react-hooks/src/hooks/useApi.js:
--------------------------------------------------------------------------------
1 | import Urbit from "@urbit/http-api";
2 | import { memoize } from 'lodash';
3 |
4 | // Memoize records (for the session) the information retrieved from Urbit.authenticate
5 | // which is the return of the promise of authentication; basically an API token that we
6 | // can use later for poke and subscribe actions
7 | //
8 | // Note, also, that you can change the ship against which you authenticate using the
9 | // ship name, url, and code arguments in the authenticate element below
10 | //
11 | const useApi = memoize(async () => {
12 | const urb = await Urbit.authenticate({ ship: 'nus', url: 'localhost:8080', code: 'bortem-pinwyl-macnyx-topdeg', verbose: true});
13 | return urb;
14 | });
15 |
16 | export default useApi;
--------------------------------------------------------------------------------
/src-lesson4/react-hooks/src/hooks/useApi.js:
--------------------------------------------------------------------------------
1 | import Urbit from "@urbit/http-api";
2 | import { memoize } from 'lodash';
3 |
4 | // Memoize records (for the session) the information retrieved from Urbit.authenticate
5 | // which is the return of the promise of authentication; basically an API token that we
6 | // can use later for poke and subscribe actions
7 | //
8 | // Note, also, that you can change the ship against which you authenticate using the
9 | // ship name, url, and code arguments in the authenticate element below
10 | //
11 | const useApi = memoize(async () => {
12 | const urb = await Urbit.authenticate({ ship: 'nus', url: 'localhost:8080', code: 'bortem-pinwyl-macnyx-topdeg', verbose: true});
13 | return urb;
14 | });
15 |
16 | export default useApi;
--------------------------------------------------------------------------------
/src-lesson5/todomvc-end/src/hooks/useApi.js:
--------------------------------------------------------------------------------
1 | import Urbit from "@urbit/http-api";
2 | import { memoize } from 'lodash';
3 |
4 | // Memoize records (for the session) the information retrieved from Urbit.authenticate
5 | // which is the return of the promise of authentication; basically an API token that we
6 | // can use later for poke and subscribe actions
7 | //
8 | // Note, also, that you can change the ship against which you authenticate using the
9 | // ship name, url, and code arguments in the authenticate element below
10 | //
11 | const useApi = memoize(async () => {
12 | const urb = await Urbit.authenticate({ ship: 'nus', url: 'localhost:8080', code: 'bortem-pinwyl-macnyx-topdeg', verbose: true});
13 | return urb;
14 | });
15 |
16 | export default useApi;
--------------------------------------------------------------------------------
/src-lesson5/todomvc-start/src/hooks/useApi.js:
--------------------------------------------------------------------------------
1 | import Urbit from "@urbit/http-api";
2 | import { memoize } from 'lodash';
3 |
4 | // Memoize records (for the session) the information retrieved from Urbit.authenticate
5 | // which is the return of the promise of authentication; basically an API token that we
6 | // can use later for poke and subscribe actions
7 | //
8 | // Note, also, that you can change the ship against which you authenticate using the
9 | // ship name, url, and code arguments in the authenticate element below
10 | //
11 | const useApi = memoize(async () => {
12 | const urb = await Urbit.authenticate({ ship: 'nus', url: 'localhost:8080', code: 'bortem-pinwyl-macnyx-topdeg', verbose: true});
13 | return urb;
14 | });
15 |
16 | export default useApi;
--------------------------------------------------------------------------------
/src-lesson6/todomvc-end/src/hooks/useApi.js:
--------------------------------------------------------------------------------
1 | import Urbit from "@urbit/http-api";
2 | import { memoize } from 'lodash';
3 |
4 | // Memoize records (for the session) the information retrieved from Urbit.authenticate
5 | // which is the return of the promise of authentication; basically an API token that we
6 | // can use later for poke and subscribe actions
7 | //
8 | // Note, also, that you can change the ship against which you authenticate using the
9 | // ship name, url, and code arguments in the authenticate element below
10 | //
11 | const useApi = memoize(async () => {
12 | const urb = await Urbit.authenticate({ ship: 'nus', url: '138.197.192.56', code: 'bortem-pinwyl-macnyx-topdeg', verbose: true});
13 | return urb;
14 | });
15 |
16 | export default useApi;
--------------------------------------------------------------------------------
/src-lesson6/todomvc-start/src/hooks/useApi.js:
--------------------------------------------------------------------------------
1 | import Urbit from "@urbit/http-api";
2 | import { memoize } from 'lodash';
3 |
4 | // Memoize records (for the session) the information retrieved from Urbit.authenticate
5 | // which is the return of the promise of authentication; basically an API token that we
6 | // can use later for poke and subscribe actions
7 | //
8 | // Note, also, that you can change the ship against which you authenticate using the
9 | // ship name, url, and code arguments in the authenticate element below
10 | //
11 | const useApi = memoize(async () => {
12 | const urb = await Urbit.authenticate({ ship: 'nus', url: 'localhost:8080', code: 'bortem-pinwyl-macnyx-topdeg', verbose: true});
13 | return urb;
14 | });
15 |
16 | export default useApi;
--------------------------------------------------------------------------------
/backup/src-lesson1/app/tudumvc/precache-manifest.d8879c74fc1a4a422c8d09e25f321cf3.js:
--------------------------------------------------------------------------------
1 | self.__precacheManifest = [
2 | {
3 | "revision": "1dc9c6f50fbb1c56c5b6",
4 | "url": "/~tudumvc/static/js/runtime~main.1dc9c6f5.js"
5 | },
6 | {
7 | "revision": "22949569891075b9302b",
8 | "url": "/~tudumvc/static/js/main.22949569.chunk.js"
9 | },
10 | {
11 | "revision": "f6a93fda9068c9bbb019",
12 | "url": "/~tudumvc/static/js/2.f6a93fda.chunk.js"
13 | },
14 | {
15 | "revision": "22949569891075b9302b",
16 | "url": "/~tudumvc/static/css/main.be9cd952.chunk.css"
17 | },
18 | {
19 | "revision": "f6a93fda9068c9bbb019",
20 | "url": "/~tudumvc/static/css/2.5ec1470f.chunk.css"
21 | },
22 | {
23 | "revision": "547c018b1c899ed7c36703407ff3be3a",
24 | "url": "/~tudumvc/index.html"
25 | }
26 | ];
--------------------------------------------------------------------------------
/src-lesson6/home (part I)/app/tudumvc/precache-manifest.42dbaf7863a6a9ee2c792afd0ef0d07b.js:
--------------------------------------------------------------------------------
1 | self.__precacheManifest = [
2 | {
3 | "revision": "b07ed4663a10508fbe23",
4 | "url": "/~tudumvc/static/css/main.be9cd952.chunk.css"
5 | },
6 | {
7 | "revision": "b07ed4663a10508fbe23",
8 | "url": "/~tudumvc/static/js/main.b07ed466.chunk.js"
9 | },
10 | {
11 | "revision": "1dc9c6f50fbb1c56c5b6",
12 | "url": "/~tudumvc/static/js/runtime~main.1dc9c6f5.js"
13 | },
14 | {
15 | "revision": "48bd3aeac52ccd92e65b",
16 | "url": "/~tudumvc/static/css/2.59cc7b1d.chunk.css"
17 | },
18 | {
19 | "revision": "48bd3aeac52ccd92e65b",
20 | "url": "/~tudumvc/static/js/2.48bd3aea.chunk.js"
21 | },
22 | {
23 | "revision": "b3e555740261a7b38498d094aaa1997d",
24 | "url": "/~tudumvc/index.html"
25 | }
26 | ];
--------------------------------------------------------------------------------
/src-lesson6/home (part II)/app/tudumvc/precache-manifest.42dbaf7863a6a9ee2c792afd0ef0d07b.js:
--------------------------------------------------------------------------------
1 | self.__precacheManifest = [
2 | {
3 | "revision": "b07ed4663a10508fbe23",
4 | "url": "/~tudumvc/static/css/main.be9cd952.chunk.css"
5 | },
6 | {
7 | "revision": "b07ed4663a10508fbe23",
8 | "url": "/~tudumvc/static/js/main.b07ed466.chunk.js"
9 | },
10 | {
11 | "revision": "1dc9c6f50fbb1c56c5b6",
12 | "url": "/~tudumvc/static/js/runtime~main.1dc9c6f5.js"
13 | },
14 | {
15 | "revision": "48bd3aeac52ccd92e65b",
16 | "url": "/~tudumvc/static/css/2.59cc7b1d.chunk.css"
17 | },
18 | {
19 | "revision": "48bd3aeac52ccd92e65b",
20 | "url": "/~tudumvc/static/js/2.48bd3aea.chunk.js"
21 | },
22 | {
23 | "revision": "b3e555740261a7b38498d094aaa1997d",
24 | "url": "/~tudumvc/index.html"
25 | }
26 | ];
--------------------------------------------------------------------------------
/backup/react-hooks/build-old/precache-manifest.d8879c74fc1a4a422c8d09e25f321cf3.js:
--------------------------------------------------------------------------------
1 | self.__precacheManifest = [
2 | {
3 | "revision": "1dc9c6f50fbb1c56c5b6",
4 | "url": "/hooks-todo/static/js/runtime~main.1dc9c6f5.js"
5 | },
6 | {
7 | "revision": "22949569891075b9302b",
8 | "url": "/hooks-todo/static/js/main.22949569.chunk.js"
9 | },
10 | {
11 | "revision": "f6a93fda9068c9bbb019",
12 | "url": "/hooks-todo/static/js/2.f6a93fda.chunk.js"
13 | },
14 | {
15 | "revision": "22949569891075b9302b",
16 | "url": "/hooks-todo/static/css/main.be9cd952.chunk.css"
17 | },
18 | {
19 | "revision": "f6a93fda9068c9bbb019",
20 | "url": "/hooks-todo/static/css/2.5ec1470f.chunk.css"
21 | },
22 | {
23 | "revision": "547c018b1c899ed7c36703407ff3be3a",
24 | "url": "/hooks-todo/index.html"
25 | }
26 | ];
--------------------------------------------------------------------------------
/src-lesson5/home/app/tudumvc/precache-manifest.4511bc68d4d49a41e2aec575c1df0d90.js:
--------------------------------------------------------------------------------
1 | self.__precacheManifest = [
2 | {
3 | "revision": "ec95fdd99b342525b0f5",
4 | "url": "/hooks-todo/static/css/main.be9cd952.chunk.css"
5 | },
6 | {
7 | "revision": "ec95fdd99b342525b0f5",
8 | "url": "/hooks-todo/static/js/main.ec95fdd9.chunk.js"
9 | },
10 | {
11 | "revision": "1dc9c6f50fbb1c56c5b6",
12 | "url": "/hooks-todo/static/js/runtime~main.1dc9c6f5.js"
13 | },
14 | {
15 | "revision": "92d7675cd9f69b608ab3",
16 | "url": "/hooks-todo/static/css/2.7aa75ec9.chunk.css"
17 | },
18 | {
19 | "revision": "92d7675cd9f69b608ab3",
20 | "url": "/hooks-todo/static/js/2.92d7675c.chunk.js"
21 | },
22 | {
23 | "revision": "a13fa720e44da41dc0b4fbfd59d05e54",
24 | "url": "/hooks-todo/index.html"
25 | }
26 | ];
--------------------------------------------------------------------------------
/backup/home-react-full/app/todoreact/precache-manifest.d8879c74fc1a4a422c8d09e25f321cf3.js:
--------------------------------------------------------------------------------
1 | self.__precacheManifest = [
2 | {
3 | "revision": "1dc9c6f50fbb1c56c5b6",
4 | "url": "/~todoreact/static/js/runtime~main.1dc9c6f5.js"
5 | },
6 | {
7 | "revision": "22949569891075b9302b",
8 | "url": "/~todoreact/static/js/main.22949569.chunk.js"
9 | },
10 | {
11 | "revision": "f6a93fda9068c9bbb019",
12 | "url": "/~todoreact/static/js/2.f6a93fda.chunk.js"
13 | },
14 | {
15 | "revision": "22949569891075b9302b",
16 | "url": "/~todoreact/static/css/main.be9cd952.chunk.css"
17 | },
18 | {
19 | "revision": "f6a93fda9068c9bbb019",
20 | "url": "/~todoreact/static/css/2.5ec1470f.chunk.css"
21 | },
22 | {
23 | "revision": "547c018b1c899ed7c36703407ff3be3a",
24 | "url": "/~todoreact/index.html"
25 | }
26 | ];
--------------------------------------------------------------------------------
/backup/react-hooks/src/index.js:
--------------------------------------------------------------------------------
1 | import "core-js/es6/map";
2 | import "core-js/es6/set";
3 | import "raf/polyfill";
4 |
5 | import React from "react";
6 | import ReactDOM from "react-dom";
7 |
8 | import "./index.css";
9 | import App from "./App/App";
10 | import * as serviceWorker from "./serviceWorker";
11 | import useApi from "./hooks/useApi";
12 |
13 | const root = document.getElementById("root");
14 |
15 | // We need to make the React.DOM asynchronously await the completion
16 | // of the promise of useApi (defined in useApi.js)
17 | //
18 | (async () => {
19 | const api = await useApi();
20 | ReactDOM.render(, root);
21 | })();
22 |
23 | // If you want your app to work offline and load faster, you can change
24 | // unregister() to register() below. Note this comes with some pitfalls.
25 | // Learn more about service workers: http://bit.ly/CRA-PWA
26 | serviceWorker.register();
27 |
--------------------------------------------------------------------------------
/src-lesson3/react-hooks/src/App/App.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { HashRouter, Route } from "react-router-dom";
3 | import "todomvc-app-css/index.css";
4 |
5 | import Footer from "../components/Footer";
6 | import TodoList from "../containers/TodoList";
7 |
8 | // We've added props to what App.js receives
9 | //
10 | export default function App(props) {
11 | // And we're creating a const object of api from that prop
12 | // Further - in the return, below, we're passing the unpacked version
13 | // of props, and the api to TodoList.js
14 | //
15 | const {api} = props;
16 | return (
17 |
18 |
19 |
20 | {
21 | return
22 | }} />
23 |
24 |
25 |
26 |
27 | );
28 | }
29 |
--------------------------------------------------------------------------------
/src-lesson4/react-hooks/src/App/App.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { HashRouter, Route } from "react-router-dom";
3 | import "todomvc-app-css/index.css";
4 |
5 | import Footer from "../components/Footer";
6 | import TodoList from "../containers/TodoList";
7 |
8 | // We've added props to what App.js receives
9 | //
10 | export default function App(props) {
11 | // And we're creating a const object of api from that prop
12 | // Further - in the return, below, we're passing the unpacked version
13 | // of props, and the api to TodoList.js
14 | //
15 | const {api} = props;
16 | return (
17 |
18 |
19 |
20 | {
21 | return
22 | }} />
23 |
24 |
25 |
26 |
27 | );
28 | }
29 |
--------------------------------------------------------------------------------
/src-lesson5/todomvc-end/src/App/App.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { HashRouter, Route } from "react-router-dom";
3 | import "todomvc-app-css/index.css";
4 |
5 | import Footer from "../components/Footer";
6 | import TodoList from "../containers/TodoList";
7 |
8 | // We've added props to what App.js receives
9 | //
10 | export default function App(props) {
11 | // And we're creating a const object of api from that prop
12 | // Further - in the return, below, we're passing the unpacked version
13 | // of props, and the api to TodoList.js
14 | //
15 | const {api} = props;
16 | return (
17 |
18 |
19 |
20 | {
21 | return
22 | }} />
23 |
24 |
25 |
26 |
27 | );
28 | }
29 |
--------------------------------------------------------------------------------
/src-lesson5/todomvc-start/src/App/App.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { HashRouter, Route } from "react-router-dom";
3 | import "todomvc-app-css/index.css";
4 |
5 | import Footer from "../components/Footer";
6 | import TodoList from "../containers/TodoList";
7 |
8 | // We've added props to what App.js receives
9 | //
10 | export default function App(props) {
11 | // And we're creating a const object of api from that prop
12 | // Further - in the return, below, we're passing the unpacked version
13 | // of props, and the api to TodoList.js
14 | //
15 | const {api} = props;
16 | return (
17 |
18 |
19 |
20 | {
21 | return
22 | }} />
23 |
24 |
25 |
26 |
27 | );
28 | }
29 |
--------------------------------------------------------------------------------
/src-lesson6/todomvc-end/src/App/App.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { HashRouter, Route } from "react-router-dom";
3 | import "todomvc-app-css/index.css";
4 |
5 | import Footer from "../components/Footer";
6 | import TodoList from "../containers/TodoList";
7 |
8 | // We've added props to what App.js receives
9 | //
10 | export default function App(props) {
11 | // And we're creating a const object of api from that prop
12 | // Further - in the return, below, we're passing the unpacked version
13 | // of props, and the api to TodoList.js
14 | //
15 | const {api} = props;
16 | return (
17 |
18 |
19 |
20 | {
21 | return
22 | }} />
23 |
24 |
25 |
26 |
27 | );
28 | }
29 |
--------------------------------------------------------------------------------
/src-lesson6/todomvc-start/src/App/App.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { HashRouter, Route } from "react-router-dom";
3 | import "todomvc-app-css/index.css";
4 |
5 | import Footer from "../components/Footer";
6 | import TodoList from "../containers/TodoList";
7 |
8 | // We've added props to what App.js receives
9 | //
10 | export default function App(props) {
11 | // And we're creating a const object of api from that prop
12 | // Further - in the return, below, we're passing the unpacked version
13 | // of props, and the api to TodoList.js
14 | //
15 | const {api} = props;
16 | return (
17 |
18 |
19 |
20 | {
21 | return
22 | }} />
23 |
24 |
25 |
26 |
27 | );
28 | }
29 |
--------------------------------------------------------------------------------
/backup/lesson1-2-the-L-ship.md:
--------------------------------------------------------------------------------
1 | # Creating `-L` Ships
2 | [_Courtesy of ~timluc-miptev's Gall Guide_](https://github.com/timlucmiptev/gall-guide/blob/master/workflow.md#-l-ships)
3 |
4 | Sometimes you want your development ships to have large datasets, such as the data in a real ship of yours. In these cases, the best option is to run a real ship with the `-L` command line flag, which turns off its networking so that you can do dangerous operations and then delete the ship when you're done.
5 |
6 | Be careful with `-L` ships!. If you don't follow the steps below (particulary copying the "real" directory or starting with the `-L` flag), you could have to breach.
7 |
8 | To run an `-L` ship, do the following steps:
9 |
10 | * Copy your existing ship's folder to a new folder, e.g.: `cp -r rabsef-bicrym fake-rabsef`
11 | * Run like so: `./urbit -L fake-rabsef`
12 |
13 |
14 |
19 |
20 |
35 |
36 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/backup/lesson1-4-hosting-options.md:
--------------------------------------------------------------------------------
1 | # Cloud Hosting Options for Urbit
2 | You certainly do not have to run your Urbit from a cloud computer. Many people run theirs on their local laptop. Going off- and on-line is absolutely fine and each time your Urbit connects to the general Urbit network it will receive all incoming messages that have been pending for it. While this guide assumes you're running Urbit locally, you can easily use one of the platforms below and do your dev remotely.
3 |
4 | ## Getting a Hosting Platform
5 | There are several options that you can choose from for cloud-hosted Linux systems, but the most common are linked below. Get one:
6 |
7 | **Tlon**
8 | [Reserve your space now](https://urbit.typeform.com/to/zQ9QOV3Z#source=tlon_io).
9 |
10 | **DigitalOcean**
11 | 1. Create a [DigitalOcean Account and Add a Project and Droplet to your Account](https://www.digitalocean.com/docs/droplets/how-to/create/#:~:text=You%20can%20create%20one%20from,open%20the%20Droplet%20create%20page.)
12 | * **NOTE:** You likely only need the the $10/mo (2GB RAM, 1 CPU, 50 GB SSD, 2 TB Transfer) and could even possibly get away with the $5/mo option, if you want to fiddle with the swap space.
13 | 2. Generate [SSH Keys and Add Them to Your Droplet](https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/)
14 | 3. Connect to your [Droplet (potentially using Visual Studio Code - that's what I like!)](https://www.digitalocean.com/community/tutorials/how-to-use-visual-studio-code-for-remote-development-via-the-remote-ssh-plugin)
15 |
16 | **SSDNodes**
17 | 1. Create a [SSDNodes Account and Create a Server](https://www.ssdnodes.com/)
18 | * **NOTE:** Again, you likely only need the minimal service they provide - choose as you see fit, though
19 | 2. Generate [SSH Keys and Connect to Your SSDNode Securely](https://blog.ssdnodes.com/blog/connecting-vps-ssh-security/)
20 |
21 | Once you have your hosted Linux solution in place and can log in as a non-root user to that system, proceed.
22 |
23 |
24 |
--------------------------------------------------------------------------------
/backup/react-hooks/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
23 |
24 |
33 | todos
34 |
35 |
36 |
37 |
40 |
41 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src-lesson2/react-hooks/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
23 |
24 |
33 | todos
34 |
35 |
36 |
37 |
40 |
41 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src-lesson3/react-hooks/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
23 |
24 |
33 | todos
34 |
35 |
36 |
37 |
40 |
41 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src-lesson4/react-hooks/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
23 |
24 |
33 | todos
34 |
35 |
36 |
37 |
40 |
41 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src-lesson5/todomvc-end/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
23 |
24 |
33 | todos
34 |
35 |
36 |
37 |
40 |
41 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src-lesson5/todomvc-start/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
23 |
24 |
33 | todos
34 |
35 |
36 |
37 |
40 |
41 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src-lesson6/todomvc-end/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
23 |
24 |
33 | todos
34 |
35 |
36 |
37 |
40 |
41 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src-lesson6/todomvc-start/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
23 |
24 |
33 | todos
34 |
35 |
36 |
37 |
40 |
41 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/backup/lesson4-1-ordering-our-tasks.md:
--------------------------------------------------------------------------------
1 | # Ordering Our Tasks
2 |
3 | Let's work with a task list in `dojo` to better understand - enter the following:
4 | ```
5 | >=a `(map id=@ud [label=@tU done=?])`(my :~([1 ['first task' %.n]] [2 ['second task' %.n]] [3 ['third task' %.n]]))
6 | ```
7 | Then enter just `a` and you should see something like this:
8 | ```
9 | >a
10 | {[p=id=1 q=[label='first task' done=%.n]] [p=id=2 q=[label='second task' done=%.n]] [p=id=3 q=[label='third task' done=%.n]]}
11 | ```
12 |
13 | Now we have a face of `a` stored in the `dojo` with a `map` just like our `type` `tasks` in our `/sur` file. Let's take a peek at what [`key:by`](https://github.com/urbit/urbit/blob/fab9a47a925f73f026c39f124e543e009d211978/pkg/arvo/sys/hoon.hoon#L1751) does - try:
14 | ```
15 | > ~(key by a)
16 | {id=1 id=2 id=3}
17 | ```
18 |
19 | Ok, so we can get a [`set`](https://github.com/urbit/urbit/blob/fab9a47a925f73f026c39f124e543e009d211978/pkg/arvo/sys/hoon.hoon#L1915) of all of the `key`s in the `map` we previously created. Next, we need to establish what [`tap:in`](https://github.com/urbit/urbit/blob/fab9a47a925f73f026c39f124e543e009d211978/pkg/arvo/sys/hoon.hoon#L1410) does - try:
20 | ```
21 | > =b ~(key by a)
22 | ```
23 | First, to pin our last step to a face, making things cleaner, then:
24 | ```
25 | > `(list @ud)`~(tap in b)
26 | ~[3 2 1]
27 | ```
28 |
29 | Alright, we're making progress - we've now got a list of our `id`s, and we've moved the `id` `face` which will allow us to do further manipulation to find our greatest value. Let's finish with taking a look at [`sort`](https://github.com/urbit/urbit/blob/fab9a47a925f73f026c39f124e543e009d211978/pkg/arvo/sys/hoon.hoon#L739) - try:
30 | ```
31 | =c `(list @ud)`~(tap in b)
32 | ```
33 | Again, first, to store our prior work, then:
34 | ```
35 | > +(-:(sort c gth))
36 | 4
37 | ```
38 |
39 | And there we have it, we sort `c` by [`gth`](https://github.com/urbit/urbit/blob/fab9a47a925f73f026c39f124e543e009d211978/pkg/arvo/sys/hoon.hoon#L2691) (greater than) as the criteria for sorting, then we increment it using the shorthand `+()`. We get 4, the next available `id`. After that, all we do is use that as the value of `new-id` and then use [`put:by`](https://github.com/urbit/urbit/blob/fab9a47a925f73f026c39f124e543e009d211978/pkg/arvo/sys/hoon.hoon#L1632) to add the new `label` with a `done`-ness state of `%.n` at the appropriate `id` `key` position in our `tasks` `map`.
--------------------------------------------------------------------------------
/backup/react-hooks/README.md:
--------------------------------------------------------------------------------
1 | # Hooks TODO
2 | A simple todo app built using react hooks.
3 |
4 | A live demo is available at: https://jacob-ebey.github.io/hooks-todo/
5 |
6 | ## Available Scripts
7 |
8 | In the project directory, you can run:
9 |
10 | ### `npm dev`
11 |
12 | Runs the app in the development mode.
13 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
14 |
15 | The page will reload if you make edits.
16 | You will also see any lint errors in the console.
17 |
18 | ### `npm test`
19 |
20 | Launches the test runner in the interactive watch mode.
21 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
22 |
23 | ### `npm run build`
24 |
25 | Builds the app for production to the `build` folder.
26 | It correctly bundles React in production mode and optimizes the build for the best performance.
27 |
28 | The build is minified and the filenames include the hashes.
29 | Your app is ready to be deployed!
30 |
31 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
32 |
33 | ### `npm start`
34 |
35 | Serves the production build from the "build" folder.
36 |
37 | ### `npm run deploy`
38 |
39 | Creates and deploys a production build to github pages.
40 |
41 | ### `npm run eject`
42 |
43 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
44 |
45 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
46 |
47 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
48 |
49 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
50 |
51 | ## Learn More
52 |
53 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
54 |
55 | To learn React, check out the [React documentation](https://reactjs.org/).
56 |
--------------------------------------------------------------------------------
/src-lesson2/react-hooks/README.md:
--------------------------------------------------------------------------------
1 | # Hooks TODO
2 | A simple todo app built using react hooks.
3 |
4 | A live demo is available at: https://jacob-ebey.github.io/hooks-todo/
5 |
6 | ## Available Scripts
7 |
8 | In the project directory, you can run:
9 |
10 | ### `npm dev`
11 |
12 | Runs the app in the development mode.
13 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
14 |
15 | The page will reload if you make edits.
16 | You will also see any lint errors in the console.
17 |
18 | ### `npm test`
19 |
20 | Launches the test runner in the interactive watch mode.
21 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
22 |
23 | ### `npm run build`
24 |
25 | Builds the app for production to the `build` folder.
26 | It correctly bundles React in production mode and optimizes the build for the best performance.
27 |
28 | The build is minified and the filenames include the hashes.
29 | Your app is ready to be deployed!
30 |
31 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
32 |
33 | ### `npm start`
34 |
35 | Serves the production build from the "build" folder.
36 |
37 | ### `npm run deploy`
38 |
39 | Creates and deploys a production build to github pages.
40 |
41 | ### `npm run eject`
42 |
43 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
44 |
45 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
46 |
47 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
48 |
49 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
50 |
51 | ## Learn More
52 |
53 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
54 |
55 | To learn React, check out the [React documentation](https://reactjs.org/).
56 |
--------------------------------------------------------------------------------
/src-lesson3/react-hooks/README.md:
--------------------------------------------------------------------------------
1 | # Hooks TODO
2 | A simple todo app built using react hooks.
3 |
4 | A live demo is available at: https://jacob-ebey.github.io/hooks-todo/
5 |
6 | ## Available Scripts
7 |
8 | In the project directory, you can run:
9 |
10 | ### `npm dev`
11 |
12 | Runs the app in the development mode.
13 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
14 |
15 | The page will reload if you make edits.
16 | You will also see any lint errors in the console.
17 |
18 | ### `npm test`
19 |
20 | Launches the test runner in the interactive watch mode.
21 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
22 |
23 | ### `npm run build`
24 |
25 | Builds the app for production to the `build` folder.
26 | It correctly bundles React in production mode and optimizes the build for the best performance.
27 |
28 | The build is minified and the filenames include the hashes.
29 | Your app is ready to be deployed!
30 |
31 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
32 |
33 | ### `npm start`
34 |
35 | Serves the production build from the "build" folder.
36 |
37 | ### `npm run deploy`
38 |
39 | Creates and deploys a production build to github pages.
40 |
41 | ### `npm run eject`
42 |
43 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
44 |
45 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
46 |
47 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
48 |
49 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
50 |
51 | ## Learn More
52 |
53 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
54 |
55 | To learn React, check out the [React documentation](https://reactjs.org/).
56 |
--------------------------------------------------------------------------------
/src-lesson4/react-hooks/README.md:
--------------------------------------------------------------------------------
1 | # Hooks TODO
2 | A simple todo app built using react hooks.
3 |
4 | A live demo is available at: https://jacob-ebey.github.io/hooks-todo/
5 |
6 | ## Available Scripts
7 |
8 | In the project directory, you can run:
9 |
10 | ### `npm dev`
11 |
12 | Runs the app in the development mode.
13 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
14 |
15 | The page will reload if you make edits.
16 | You will also see any lint errors in the console.
17 |
18 | ### `npm test`
19 |
20 | Launches the test runner in the interactive watch mode.
21 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
22 |
23 | ### `npm run build`
24 |
25 | Builds the app for production to the `build` folder.
26 | It correctly bundles React in production mode and optimizes the build for the best performance.
27 |
28 | The build is minified and the filenames include the hashes.
29 | Your app is ready to be deployed!
30 |
31 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
32 |
33 | ### `npm start`
34 |
35 | Serves the production build from the "build" folder.
36 |
37 | ### `npm run deploy`
38 |
39 | Creates and deploys a production build to github pages.
40 |
41 | ### `npm run eject`
42 |
43 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
44 |
45 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
46 |
47 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
48 |
49 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
50 |
51 | ## Learn More
52 |
53 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
54 |
55 | To learn React, check out the [React documentation](https://reactjs.org/).
56 |
--------------------------------------------------------------------------------
/src-lesson5/todomvc-end/README.md:
--------------------------------------------------------------------------------
1 | # Hooks TODO
2 | A simple todo app built using react hooks.
3 |
4 | A live demo is available at: https://jacob-ebey.github.io/hooks-todo/
5 |
6 | ## Available Scripts
7 |
8 | In the project directory, you can run:
9 |
10 | ### `npm dev`
11 |
12 | Runs the app in the development mode.
13 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
14 |
15 | The page will reload if you make edits.
16 | You will also see any lint errors in the console.
17 |
18 | ### `npm test`
19 |
20 | Launches the test runner in the interactive watch mode.
21 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
22 |
23 | ### `npm run build`
24 |
25 | Builds the app for production to the `build` folder.
26 | It correctly bundles React in production mode and optimizes the build for the best performance.
27 |
28 | The build is minified and the filenames include the hashes.
29 | Your app is ready to be deployed!
30 |
31 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
32 |
33 | ### `npm start`
34 |
35 | Serves the production build from the "build" folder.
36 |
37 | ### `npm run deploy`
38 |
39 | Creates and deploys a production build to github pages.
40 |
41 | ### `npm run eject`
42 |
43 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
44 |
45 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
46 |
47 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
48 |
49 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
50 |
51 | ## Learn More
52 |
53 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
54 |
55 | To learn React, check out the [React documentation](https://reactjs.org/).
56 |
--------------------------------------------------------------------------------
/src-lesson5/todomvc-start/README.md:
--------------------------------------------------------------------------------
1 | # Hooks TODO
2 | A simple todo app built using react hooks.
3 |
4 | A live demo is available at: https://jacob-ebey.github.io/hooks-todo/
5 |
6 | ## Available Scripts
7 |
8 | In the project directory, you can run:
9 |
10 | ### `npm dev`
11 |
12 | Runs the app in the development mode.
13 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
14 |
15 | The page will reload if you make edits.
16 | You will also see any lint errors in the console.
17 |
18 | ### `npm test`
19 |
20 | Launches the test runner in the interactive watch mode.
21 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
22 |
23 | ### `npm run build`
24 |
25 | Builds the app for production to the `build` folder.
26 | It correctly bundles React in production mode and optimizes the build for the best performance.
27 |
28 | The build is minified and the filenames include the hashes.
29 | Your app is ready to be deployed!
30 |
31 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
32 |
33 | ### `npm start`
34 |
35 | Serves the production build from the "build" folder.
36 |
37 | ### `npm run deploy`
38 |
39 | Creates and deploys a production build to github pages.
40 |
41 | ### `npm run eject`
42 |
43 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
44 |
45 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
46 |
47 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
48 |
49 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
50 |
51 | ## Learn More
52 |
53 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
54 |
55 | To learn React, check out the [React documentation](https://reactjs.org/).
56 |
--------------------------------------------------------------------------------
/src-lesson6/todomvc-end/README.md:
--------------------------------------------------------------------------------
1 | # Hooks TODO
2 | A simple todo app built using react hooks.
3 |
4 | A live demo is available at: https://jacob-ebey.github.io/hooks-todo/
5 |
6 | ## Available Scripts
7 |
8 | In the project directory, you can run:
9 |
10 | ### `npm dev`
11 |
12 | Runs the app in the development mode.
13 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
14 |
15 | The page will reload if you make edits.
16 | You will also see any lint errors in the console.
17 |
18 | ### `npm test`
19 |
20 | Launches the test runner in the interactive watch mode.
21 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
22 |
23 | ### `npm run build`
24 |
25 | Builds the app for production to the `build` folder.
26 | It correctly bundles React in production mode and optimizes the build for the best performance.
27 |
28 | The build is minified and the filenames include the hashes.
29 | Your app is ready to be deployed!
30 |
31 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
32 |
33 | ### `npm start`
34 |
35 | Serves the production build from the "build" folder.
36 |
37 | ### `npm run deploy`
38 |
39 | Creates and deploys a production build to github pages.
40 |
41 | ### `npm run eject`
42 |
43 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
44 |
45 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
46 |
47 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
48 |
49 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
50 |
51 | ## Learn More
52 |
53 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
54 |
55 | To learn React, check out the [React documentation](https://reactjs.org/).
56 |
--------------------------------------------------------------------------------
/src-lesson6/todomvc-start/README.md:
--------------------------------------------------------------------------------
1 | # Hooks TODO
2 | A simple todo app built using react hooks.
3 |
4 | A live demo is available at: https://jacob-ebey.github.io/hooks-todo/
5 |
6 | ## Available Scripts
7 |
8 | In the project directory, you can run:
9 |
10 | ### `npm dev`
11 |
12 | Runs the app in the development mode.
13 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
14 |
15 | The page will reload if you make edits.
16 | You will also see any lint errors in the console.
17 |
18 | ### `npm test`
19 |
20 | Launches the test runner in the interactive watch mode.
21 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
22 |
23 | ### `npm run build`
24 |
25 | Builds the app for production to the `build` folder.
26 | It correctly bundles React in production mode and optimizes the build for the best performance.
27 |
28 | The build is minified and the filenames include the hashes.
29 | Your app is ready to be deployed!
30 |
31 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
32 |
33 | ### `npm start`
34 |
35 | Serves the production build from the "build" folder.
36 |
37 | ### `npm run deploy`
38 |
39 | Creates and deploys a production build to github pages.
40 |
41 | ### `npm run eject`
42 |
43 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
44 |
45 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
46 |
47 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
48 |
49 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
50 |
51 | ## Learn More
52 |
53 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
54 |
55 | To learn React, check out the [React documentation](https://reactjs.org/).
56 |
--------------------------------------------------------------------------------
/backup/react-hooks/src/containers/TodoItem.js:
--------------------------------------------------------------------------------
1 | import React, { useCallback, useRef, useState } from "react";
2 | import useOnClickOutside from "use-onclickoutside";
3 |
4 | import useDoubleClick from "../hooks/useDoubleClick";
5 | import useOnEnter from "../hooks/useOnEnter";
6 |
7 | export default function TodoItem(props) {
8 | const [label, setLabel] = useState(props.todo.label);
9 | const [id, setID] = useState(props.todo.id);
10 | const [editing, setEditing] = useState(false);
11 |
12 | const urb = props.api
13 |
14 | const deleteTodo = (num) => {
15 | urb.poke({app: 'todoreact', mark: 'todoreact-action', json: {'remove-task': parseInt(num)}})
16 | }
17 |
18 | const toggleDone = (num) => {
19 | urb.poke({app: 'todoreact', mark: 'todoreact-action', json: {'mark-complete': parseInt(num)}})
20 | }
21 |
22 | const onDelete = useCallback(() => deleteTodo(id), [id]);
23 | const onDone = useCallback(() => toggleDone(id), [id]);
24 | const onChange = event => {
25 | setLabel(event.target.value);
26 | }
27 | const onBlur = () => {
28 | console.log(`setting urbit state to ${label} for task ${id}`);
29 | urb.poke({app: 'todoreact', mark: 'todoreact-action', json: {'edit-task': {'id': parseInt(id), 'label': label}}})
30 | }
31 |
32 | const handleViewClick = useDoubleClick(null, () => setEditing(true));
33 | const finishedCallback = useCallback(
34 | () => {
35 | onBlur();
36 | setEditing(false);
37 | },
38 | [label]
39 | );
40 |
41 | const onEnter = useOnEnter(finishedCallback, [label]);
42 |
43 | const ref = useRef();
44 |
45 | useOnClickOutside(ref, finishedCallback);
46 |
47 | return (
48 |
52 |
53 |
60 |
61 |
62 |
63 | {editing && (
64 |
74 | )}
75 |
76 | );
77 | }
78 |
--------------------------------------------------------------------------------
/backup/lesson1-3-towers-of-hanoi.md:
--------------------------------------------------------------------------------
1 | # Towers of Hanoi
2 | We're going to add a simple generator to our /gen folder, let our shell script copy it into our pier, and then run it. In the process we'll learn about `|commit`-ing our files back into our %clay filesystem when we make changes to them in the Unix filesystem. Assuming you're running your copy shell script as described in the previous subsection, take the following steps:
3 | * Copy the [hanoi generator](supplemental/hanoi.hoon) to your /gen subdirectory of your development folder (`~/urbit/devops/gen` based on our example above)
4 | * Make sure your sync function is running, e.g.: `bash dev.sh ~/urbit/nus`
5 | * This generator solves a Towers of Hanoi game with any number of starting discs on any one of the three pegs. It takes two arguments:
6 | * See: `|= [num-of-discs=@ud which-rod=?(%one %two %three)]`
7 | * Argument 1 - the number of discs in the game
8 | * Argument 2 - the starting rod
9 | * We can call this generator using `+hanoi [3 %one]` or similar. Do this in your dojo.
10 | * You've just received the error:
11 | ```
12 | /gen/hanoi/hoon
13 | %generator-build-fail
14 | ```
15 | * Your urbit is not able to find the file yet, even though it's been copied into your pier (take a look for yourself to confirm - if it hasn't, you might have an issue with your shell script)
16 | * Let's use `|commit %home` to _uptake_ the changes we made in the Unix filesystem into our urbit's `%clay` filesystem. Type that command into the dojo.
17 | * You've just seen a message somewhat like the below:
18 | ```
19 | > |commit %home
20 | >=
21 | : /~nus/home/44/gen/hanoi/hoon
22 | ```
23 | * Let's try running our generator again, using `+hanoi [3 %one]`.
24 | * You should see the following:
25 | ```
26 | ~[
27 | [rod-one=~[2 3] rod-two=~ rod-three=~[1]]
28 | [rod-one=~[3] rod-two=~[2] rod-three=~[1]]
29 | [rod-one=~[3] rod-two=~[1 2] rod-three=~]
30 | [rod-one=~ rod-two=~[1 2] rod-three=~[3]]
31 | [rod-one=~[1] rod-two=~[2] rod-three=~[3]]
32 | [rod-one=~[1] rod-two=~ rod-three=~[2 3]]
33 | [rod-one=~ rod-two=~ rod-three=~[1 2 3]]
34 | ]
35 | ```
36 | * And just like that, you've confirmed that your dev environment is set up to house your development files, outside of your pier, with a replication system in place to automatically copy them _into_ your pier.
37 |
38 |
39 |