(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /************************************************ | |
| FILENAME | |
| server_simple.js | |
| DESCRIPTION | |
| creates a simple web server that | |
| display "Hello Dynamic World Wide Web" | |
| HOW TO START SERVER: | |
| 1) from terminal run 'node simple_server.js' |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8 /> | |
| <title>Holy Grail</title> | |
| <style> | |
| /* some basic styles. nothing to do with flexbox */ | |
| header, footer, | |
| nav, article, aside { | |
| border: 1px solid black; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.
Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.
| FROM python:3.5.2 | |
| RUN apt-get update \ | |
| && apt-get install -y gettext curl sudo \ | |
| && curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - \ | |
| && apt-get install -y nodejs \ | |
| && apt-get install -y libpng-dev libtiff5-dev libjpeg62-turbo-dev zlib1g-dev \ | |
| libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk \ | |
| libopenjpeg-dev pngquant libmagickwand-dev imagemagick \ | |
| && apt-get autoremove -y --purge \ |
| -- Below is a fancy version of non-null-greatest() for multi-columns. | |
| -- it is more extensible for more two columns. | |
| WITH base AS ( | |
| SELECT | |
| (SELECT ARRAY_AGG (x IGNORE NULLS) AS Y FROM UNNEST ([col_1, col_2, col_3, col_4]) AS x) | |
| AS array, | |
| FROM source_table AS nl | |
| ) | |
| SELECT | |
| (SELECT MAX(y) FROM UNNEST(array) AS Y |
The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.
This means you have the following choices:
import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.await import(…) from CommonJS instead of require(…).| import os | |
| os.environ["OPENAI_API_KEY"] = "" | |
| from flask import Flask, Response, request | |
| import threading | |
| import queue | |
| from langchain.chat_models import ChatOpenAI | |
| from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler | |
| from langchain.schema import AIMessage, HumanMessage, SystemMessage |