tsfun; lxc updates
authorBill Erickson <berickxx@gmail.com>
Mon, 1 Apr 2019 22:10:10 +0000 (18:10 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 1 Apr 2019 22:10:10 +0000 (18:10 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
lxc.adoc
tsfun.adoc [new file with mode: 0644]

index 81f9465..3241188 100644 (file)
--- a/lxc.adoc
+++ b/lxc.adoc
 == Limitations
 
 * Linux only
-* Some commands cannot be run (e.g. sysctl)
 
 == Create a Disk (OPTIONAL)
 
 * Many ways to do this.
 * ZFS and btrfs recommended
 ** https://lxd.readthedocs.io/en/latest/storage/
-
-[source,sh]
---------------------------------------------------------------------------
-lxc storage create pool1 btrfs source=/VM
---------------------------------------------------------------------------
+* ZFS is more stable and easier to set up.
 
 == Init LXD and Create an Image
 
 [source,sh]
 --------------------------------------------------------------------------
-sudo lxd init # tell it about the storage pool
+sudo lxd init # create new zfs pool from a partition
 sudo lxc launch ubuntu:16.04 eg-dev
 sudo lxc exec eg-dev -- bash
 --------------------------------------------------------------------------
diff --git a/tsfun.adoc b/tsfun.adoc
new file mode 100644 (file)
index 0000000..284a5f8
--- /dev/null
@@ -0,0 +1,84 @@
+= Visual Studio Code For Developers
+:author: Bill Erickson, Software Development Engineer, King County Library System
+:email: berickxx@gmail.com
+:date: Evergreen Conference 2019
+:duration: 5
+:backend: slidy
+:max-width: 45em
+:deckjs_theme: web-2.0
+
+== 5 Angular / Typescript Tips
+
+== Getters and Setters
+
+[source,javascript]
+-------------------------------------------------------------------------
+private _msg: string;
+set msg(s: string) {
+    console.debug('Got a new msg:', s);
+    this._msg = s;
+}
+get msg(): string {
+    return this._msg;
+}
+
+this.msg = "hello"; // Produces console message
+// NOT this.msg("hello") or this.msg()
+-------------------------------------------------------------------------
+
+== Async Functions
+
+* Any function that returns a promise can be prefixed with the 'async' 
+  keyword
+* Any 'async' function that calls another 'async' function can 'await'
+  the results of the called function.
+* The result of the called function is the value passed to the promise
+  resolution.
+* You can write async code that looks like sync code.
+
+== Async Functions: Promise Chain
+
+[source,javascript]
+-------------------------------------------------------------------------
+async modifyCar(): Promise<any> {
+    return loadCar()
+        .then((car: Car) => this.colorDialog.open(car))
+
+        .then((color: string) => this.applyColor(color))
+
+        .then((cost: number) => this.addCost(cost))
+}
+-------------------------------------------------------------------------
+
+== Async Functions: await
+
+[source,javascript]
+-------------------------------------------------------------------------
+
+async modifyCarColor(): Promise<any> {
+
+    const car: Car = await loadCar(); 
+
+    const color: string = await this.colorDialog.open(car);
+
+    const cost: number = await this.applyColor(color);
+
+    return this.addCost(cost);
+}
+-------------------------------------------------------------------------
+
+== Async Functions: loadCar()
+
+[source,javascript]
+-------------------------------------------------------------------------
+async loadCar(): Promise<Car> {
+    return new Promise((resolve, reject) => {
+        // Network stuff that takes time...
+        resolve(myCar);
+    });
+}
+-------------------------------------------------------------------------
+
+
+
+