Ruby | Core methods written in Ruby | Total number of core methods | % written in Ruby |
---|---|---|---|
CRuby 2.3 | 3 | 1637 | 0.2% |
CRuby 2.4 | 3 | 1636 | 0.2% |
CRuby 2.5 | 6 | 1680 | 0.4% |
CRuby 2.6 | 5 | 1767 | 0.3% |
CRuby 2.7 | 38 | 1802 | 2.1% |
CRuby 3.0 | 89 | 1830 | 4.9% |
CRuby 3.1 | 112 | 1884 | 5.9% |
CRuby 3.2 | 128 | 1924 | 6.7% |
#!/usr/bin/ruby | |
# encoding: utf-8 | |
require 'sqlite3' | |
if ARGV.length < 2 | |
puts "Please give two arguments:" | |
puts " - arg1: OpenScale sqlite3 database (*.db)" | |
puts " - arg2: weightlogger sqlite3 database (*.bkp)" | |
puts "" |
-
Install Termux, an Android terminal emulator that provides a Linux execution environment and various tools.
-
Update system packages in Termux:
$ pkg update -y
crystal: 0.34.0 | |
dependencies: | |
lucky: | |
github: luckyframework/lucky | |
version: ~> 0.21 | |
shrine: | |
github: jetrockets/shrine.cr | |
version: ~> 0.8 |
This function takes a string that is in Latin-1 (ISO-8859-1), UTF-8, or plain ASCII and returns the string properly encoded as UTF-8. In addition, any Microsoft smart quotes (stupid quotes) are replaced with plain ASCII equivalents. This is useful for reading CSV files or other text files from a web upload and getting to a "known good" state. |
require "statistics" | |
require "ishi" | |
require "tablo" | |
include Statistics::Distributions | |
# Turns a named tuple into tabular representation | |
def table(data : NamedTuple) | |
Tablo::Table.new(data.map { |k, v| [k, v] }, header_frequency: nil) { |t| | |
t.add_column("coefficient") { |n| n[0] } |
This gist is to configure a Mosquitto MQTT Broker behind a Traefik reverse-proxy, both in a docker container. Mosquitto will be configuread as a TCP Service.
This is a simple configuration used on the same single server. Probably to be adapted for other cases. Having mosquitto behind a reverse proxy enables you to configure TLS on Traefik (likely you already do that for other applications as well) and to load balance different MQTT instances, but that goes beyond this gist.
As noted in Traefik docs, in the router you must use the rule HostSNI(`*`)
when using non-TLS routers like in this example. Ref. https://docs.traefik.io/routing/routers/#rule_1
docker-compose.yml
FROM golang:1.14-alpine | |
COPY . /go/src/app | |
WORKDIR /go/src/app | |
RUN go get -v -d | |
RUN go install | |
CMD ["app"] |