We will be using following information throughout this article:
index_name : customers
index_type : personal
customer will have name,age,gender,email,phone,address,city,state as fields in schema for now
# A basic re-implementation of gron in JQ | |
# Operates in a streaming manner, without having to read the entire input first or hold it in memory | |
# Try: cat big.json | while read; do printf '%s\n' "$REPLY"; sleep 0.1; done | jqgron | |
# Most operations are slower than gron, but `jqgron -u -j` is actually faster! | |
def topath: | |
map(if (tostring|test("\\A[[:alpha:]$_][[:alnum:]$_]*\\z")|not) | |
then "[\(tojson)]" else ".\(.)" end) | join(""); | |
def tojqpath: | |
topath | if .[0:1] == "[" then "." + . else . end; |
Photo by Ricardo Gomez Angel on Unsplash
This gist is a collection of common patterns I've personally used here and there with Custom Elements.
These patterns are all basic suggestions that could be improved, enriched, readapted, accordingly with your needs.
My macos system/dotfile bootstrap process uses brew bundle
to install some apps.
This takes a while to complete, so I hoped to use an Automator Folder Action workflow to
watch the /Applications/
directory and launch a few apps that require logins
as soon as brew bundle
finishes installing them.
Automator did not do a good job of this (I did 3 test runs and it never opened each of the apps in the trigger list), but I didn't realize that until after I figured out how to actually install and activate the workflow during my bootstrap process. I wanted to go ahead and share the bits of this process in the hope someone else trying to accomplish the same will need a little less work.
ClickHouse server version 18.14.12 revision 54409. | |
create table data(K Int64, V String) engine=MergeTree order by K; | |
insert into data select number, toString(number) from numbers(100,100000000); | |
optimize table data final; | |
create table buffer(K Int64, V String) engine=Memory; | |
insert into buffer select number, toString(number) from numbers(0,1000); | |
Feedback loop speed in one of the biggest contributing factors to overall development time. The faster you get results, the faster you can move on to other things. A fast enough test suite is therefore critical to teams' success, and is worth investing some time at the beginning to save in the long run.
Below is a list of techniques for speeding up a Rails test suite. It is not comprehensive, but should definitely provide some quick wins. This list of techniques assumes you're using minitest
, but most everything should translate over to rspec
by simply replacing test/test_helper.rb
with spec/spec_helper.rb
.
version: '2' | |
services: | |
api: | |
volumes: | |
- "nfsmount:${CONTAINER_DIR}" | |
volumes: | |
nfsmount: | |
driver: local | |
driver_opts: |
DROP TABLE IF EXISTS requests; | |
CREATE TABLE requests ( | |
request_date Date, | |
request_time DateTime, | |
response_time Int, | |
request_uri String) | |
ENGINE = MergeTree(request_date, (request_time, request_uri), 8192); | |