Skip to content

Instantly share code, notes, and snippets.

@AlexMikhalev
AlexMikhalev / taury_tray.rs
Created Jun 15, 2021
Taury Apps tray icon
View taury_tray.rs
fn main() {
let show = CustomMenuItem::new("show".to_string(), "Show");
let hide = CustomMenuItem::new("hide".to_string(), "Hide");
let quit = CustomMenuItem::new("quit".to_string(), "Quit");
let tray_menu_items = vec![
SystemTrayMenuItem::Custom(show),
SystemTrayMenuItem::Custom(hide),
SystemTrayMenuItem::Separator,
SystemTrayMenuItem::Custom(quit),
@AlexMikhalev
AlexMikhalev / inexact-search-aho-corasick.ipynb
Created Jun 1, 2021 — forked from sujitpal/inexact-search-aho-corasick.ipynb
Code demonstrating building and querying an Aho-Corasick FSM for inexact search
View inexact-search-aho-corasick.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View reinstall_jupyter_rust.bash
cargo install evcxr_jupyter
jupyter --list
jupyter kernelspec list
jupyter kernelspec uninstall rust
evcxr_jupyter --install
View redis import csv.bash
cat data.csv | awk -F',' '{print " SET \""$1"\" \""$2"\" \n"}' | redis-cli --pipe
View redis_py_cluster.py
python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from rediscluster import RedisCluster
>>> import logging
>>> import logging
>>>
>>> from rediscluster import RedisCluster
>>>
@AlexMikhalev
AlexMikhalev / bug_10_05_2021
Created May 10, 2021
Potential bug report
View bug_10_05_2021
1775:M 10 May 2021 13:19:53.513 * <rg> langdetect is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
1775:M 10 May 2021 13:19:53.513 * <rg> six is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
1775:M 10 May 2021 13:20:02.307 * <ai> TORCH backend loaded from /usr/lib/redis/modules/backends/redisai_torch/redisai_torch.so
1775:M 10 May 2021 13:20:09.973 * Reading the remaining AOF tail...
1775:M 10 May 2021 13:20:15.081 * DB loaded from append only file: 30.166 seconds
1775:M 10 May 2021 13:20:15.081 * Ready to accept connections
1775:M 10 May 2021 13:20:15.284 # <rg> Failed on XINFO command : got null reply
@AlexMikhalev
AlexMikhalev / rclusterlogs.txt
Created May 10, 2021
docker logs -f rgcluster
View rclusterlogs.txt
docker logs -f rgcluster
Starting 30001
Starting 30002
Starting 30003
Starting 30004
Starting 30005
Starting 30006
Starting 30007
Starting 30008
Starting 30009
View QA Search API example
curl -H "Content-Type: application/json" -X POST -d '{"search":"How does temperature and humidity affect the transmission of 2019-nCoV?"}' https://api.thepattern.digital/qasearch | jq .results
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 31540 100 31456 100 84 1770 4 0:00:21 0:00:17 0:00:04 6940
[
{
"answer": "community transmission",
"sentence": "At the time of this review April 6 2020 the disease termed covID 19 corona virus disease 2019 had become pandemic and spread to more than 203 countries and territories including community transmission in countries like the United States Germany France sPain Japan Singapore South Korea iRan and Italy and a large scale outbreak with more than 600 cases on the cruise ship Diamond Princess",
"sentencekey": "sentence:0020ab317ef923b740c1d3db52083a4e48495f8a:{5M5}:8",
"title": "SARS-CoV-2 Vaccines: Status Report"
View gist:ec56d96658093e91942ee36e30774a55
10:M 30 Apr 2021 21:27:20.002 * <rg> GEARS: QA cached called {'event': 'keymiss', 'key': 'cache_{06S}_{PMC261870.xml:{06S}:26}_Laser Correction', 'type': 'empty', 'value': None}
=== REDIS BUG REPORT START: Cut & paste starting from here ===
10:M 30 Apr 2021 21:27:20.002 # === ASSERTION FAILED ===
10:M 30 Apr 2021 21:27:20.002 # ==> module.c:4085 '(c->flags & CLIENT_BLOCKED) == 0' is not true
------ STACK TRACE ------
Backtrace: