(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.
use anyhow::*; | |
use futures::io::{copy, AsyncReadExt, AsyncWriteExt}; | |
use futures::stream::StreamExt; | |
use log::*; | |
use smol::Async; | |
use std::net; | |
const PORT: u16 = 5000; |
use std::net::{TcpListener, SocketAddr, TcpStream, Shutdown, SocketAddrV4, Ipv4Addr}; | |
use std::str::FromStr; | |
use std::thread::{spawn, JoinHandle}; | |
use std::io::{BufReader, BufWriter, Read, Write}; | |
fn pipe(incoming: &mut TcpStream, outgoing: &mut TcpStream) -> Result<(), String> { | |
let mut buffer = [0; 1024]; | |
loop { | |
match incoming.read(&mut buffer) { | |
Ok(bytes_read) => { |
import ( | |
"archive/zip" | |
"io" | |
"os" | |
"path/filepath" | |
"strings" | |
) | |
func zipit(source, target string) error { | |
zipfile, err := os.Create(target) |
CREATE EXTENSION btree_gist; | |
CREATE TABLE room_reservations ( | |
room_id integer, | |
reserved_at timestamptz, | |
reserved_until timestamptz, | |
canceled boolean DEFAULT false, | |
EXCLUDE USING gist ( | |
room_id WITH =, tstzrange(reserved_at, reserved_until) WITH && | |
) WHERE (not canceled) |
(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.
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers