Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "os" | |
| "github.com/pkg/sftp" | |
| "golang.org/x/crypto/ssh" | |
| kh "golang.org/x/crypto/ssh/knownhosts" |
| Vagrant.configure("2") do |config| | |
| config.vm.box = "ubuntu/bionic64" | |
| config.vm.provider :virtualbox do |v| | |
| v.gui = true | |
| v.memory = 2048 | |
| end | |
| # Currently "ubuntu/bionic64" on VirtualBox requires `type: "virtualbox"` | |
| # to make synced folder works. |
| #!/bin/bash | |
| # This script subscribes to a MQTT topic using mosquitto_sub. | |
| # On each message received, you can execute whatever you want. | |
| while true # Keep an infinite loop to reconnect when connection lost/broker unavailable | |
| do | |
| mosquitto_sub -h "127.0.0.1" -t "test" | while read -r payload | |
| do | |
| # Here is the callback to execute whenever you receive a message: |
| const http = require('http'); | |
| const log = console.log; | |
| console.log = (...args) => { | |
| log.apply(console, [new Date().toISOString()].concat(args)); | |
| }; | |
| const port = process.argv[2]; | |
| const server = http.createServer((req, res) => { | |
| console.log('Incoming request'); |
| //JavaScript implementation of winding number algorithm to determine whether a point is inside a polygon | |
| //Based on C++ implementation of wn_PnPoly() published on http://geomalgorithms.com/a03-_inclusion.html | |
| function pointInPolygon(point, vs) { | |
| const x = point[0], y = point[1]; | |
| let wn = 0; | |
| for (let i = 0, j = vs.length - 1; i < vs.length; j = i++) { | |
| let xi = vs[i][0], yi = vs[i][1]; | |
| let xj = vs[j][0], yj = vs[j][1]; |
Free O'Reilly books and convenient script to just download them.
Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post
How to use:
download.sh file and put it into a directory where you want the files to be saved.cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
| GATEWAY_FLAGS := -I. -I/usr/local/include -I$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis -I/usr/local/include | |
| GRPC_FLAGS := --python_out=. --grpc_python_out=. | |
| code: | |
| python -m grpc_tools.protoc $(GRPC_FLAGS) $(GATEWAY_FLAGS) *.proto | |
| gw: | |
| protoc $(GATEWAY_FLAGS) \ | |
| --go_out=Mgoogle/api/annotations.proto=github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api,plugins=grpc:. \ |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <fcntl.h> | |
| #include <errno.h> | |
| #include <linux/input.h> | |
| #include <linux/uinput.h> | |
| #define die(str, args...) do { \ |