Skip to content

Instantly share code, notes, and snippets.

Mix.install([:mint, :castore])
defmodule Main do
def run() do
total =
Stream.resource(
fn ->
{:ok, conn} = Mint.HTTP.connect(:https, "ftp.bit.nl", 443, mode: :passive)
{:ok, conn, _ref} = Mint.HTTP.request(conn, "GET", "/speedtest/10mb.bin", [], nil)
{conn, true}
Mix.install([:mint])
defmodule Main do
require Logger
@byte_count 8192
def run() do
{:ok, conn} = Mint.HTTP.connect(:http, "speed.transip.nl", 80, mode: :passive)
{:ok, conn, _req_ref} = Mint.HTTP.request(conn, "GET", "/10mb.bin", [], "")
From c515297e3003ad2471df788f241a487d5b77ac40 Mon Sep 17 00:00:00 2001
From: Tom Taylor <tom@tomtaylor.co.uk>
Date: Fri, 2 Oct 2020 10:05:55 +0100
Subject: [PATCH] Add integration test to trap left lateral join bug
---
integration_test/cases/joins.exs | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/integration_test/cases/joins.exs b/integration_test/cases/joins.exs
cypress_runner.js:197680 Console was cleared
cypress_runner.js:197677 TypeError: The following error originated from your application code, not from Cypress.
> Cannot read property 'getDescendentByEl' of undefined
When Cypress detects uncaught errors originating from your application it will automatically fail the current test.
This behavior is configurable, and you can choose to turn this off by listening to the `uncaught:exception` event.
at LiveSocket.getViewByEl (webpack://phoenix_live_view/./js/phoenix_live_view.js?./node_modules/babel-loader/lib:908:38)
at eval (webpack://phoenix_live_view/./js/phoenix_live_view.js?./node_modules/babel-loader/lib:882:23)
{
"logger": {
"level": "debug",
"timestamp": false
},
"esclient": {
"apiVersion": "7.5",
"hosts": [{ "host": "elasticsearch" }]
},
"elasticsearch": {
@tomtaylor
tomtaylor / pelias.json
Created May 6, 2020 15:35
Debugging Pelias import
{
"logger": {
"level": "debug",
"timestamp": false
},
"esclient": {
"apiVersion": "7.5",
"hosts": [{ "host": "elasticsearch" }]
},
"elasticsearch": {
@tomtaylor
tomtaylor / refresh.js
Created April 23, 2020 19:36
Google Sheets macro to refresh all the data source sheets in the current file
/** @OnlyCurrentDoc */
function RefreshData() {
var spreadsheet = SpreadsheetApp.getActive();
SpreadsheetApp.enableAllDataSourcesExecution();
spreadsheet.getDataSourceTables().forEach(function(dataSourceTable) { dataSourceTable.refreshData() });
};
commit 96efd048f3e30dbff39ace91a9b936acfafd46b4 (HEAD -> sync-against-ons-postcode-directory, tomtaylor/sync-against-ons-postcode-directory, master)
Author: Tom Taylor <tom@tomtaylor.co.uk>
Date: Tue Aug 20 08:54:05 2019 +0000
Sync with May 2019 ONS Postcode Directory
diff --git a/data/437/369/083/437369083.geojson b/data/437/369/083/437369083.geojson
index 3e7c98891a383..f753fd67f88dd 100644
--- a/data/437/369/083/437369083.geojson
+++ b/data/437/369/083/437369083.geojson
@tomtaylor
tomtaylor / plug_canonical_domain.ex
Last active January 17, 2019 20:47
Redirect requests to the host of the url defined in your endpoint. Expects an upstream proxy to have set X-Forwarded-Proto and X-Forwarded-Port.
defmodule PoplarWeb.PlugCanonicalDomain do
import Plug.Conn
import Phoenix.Controller
alias Plug.Conn
def init(opts), do: opts
def call(conn, _opts) do
endpoint_url = endpoint_url_struct()
conn_url = conn_url_struct(conn)
@tomtaylor
tomtaylor / run.sh
Created January 12, 2019 14:44
Convert a video frame into a dithered bmp for display on an e-Paper screen
# Install ffmpeg, imagemagick
ffmpeg -ss 00:01:00.00 -i input.avi -frames 1 -vf "scale=640:384:force_original_aspect_ratio=decrease,pad=640:384:(ow-iw)/2:(oh-ih)/2" -vcodec png -f image2pipe pipe:1 | convert -colorspace Rec709Luma -dither FloydSteinberg -remap pattern:gray50 - bmp:- | cat > image.bmp