Skip to content

Instantly share code, notes, and snippets.

View AlexMikhalev's full-sized avatar

Dr Alexander Mikhalev AlexMikhalev

View GitHub Profile
@AlexMikhalev
AlexMikhalev / get-obsidian-posts.py
Created January 19, 2021 13:46
Sync notion to obsidian world md
from notion.client import NotionClient
import datetime
import os
from slugify import slugify
import re
import requests
import time
import hashlib
import shutil
import sys
@AlexMikhalev
AlexMikhalev / config.toml
Created October 15, 2023 16:33
Helix Editor
# Editor Config
theme = "catppuccin_macchiato"
[editor]
scrolloff = 6
mouse = true
middle-click-paste = true
scroll-lines = 3
shell = [ "zsh","-c" ]
line-number = "absolute"
@AlexMikhalev
AlexMikhalev / python_time.py
Created May 11, 2023 14:52
Monitonic time in NS in python
import time
time_ns = time.monotonic_ns()
@AlexMikhalev
AlexMikhalev / sensor.jsonl
Created March 14, 2023 14:19
Synthetic data based on cloud events spec
{"data":"<much wow=\"xml\"/>","device_id":3,"device_type":"accelerometer","id":0,"timestamp":"2017-05-31T04:10:48+0000"}
{"data":{"appinfoA":"abc","appinfoB":123,"appinfoC":true},"device_id":1,"device_type":"temperature","id":1,"timestamp":"2013-07-17T23:18:51+0000"}
{"data":1.5,"device_id":1,"device_type":"flow","id":2,"timestamp":"2013-04-26T07:34:51+0000"}
{"data":"I'm just a string","device_id":3,"device_type":"accelerometer","id":3,"timestamp":"2001-10-01T22:52:57+0000"}
{"data":"eyAieHl6IjogMTIzIH0=","device_id":1,"device_type":"temperature","id":4,"timestamp":"2005-01-01T09:05:50+0000"}
{"data":"<much wow=\"xml\"/>","device_id":1,"device_type":"flow","id":5,"timestamp":"2012-09-08T19:14:16+0000"}
{"data":{"appinfoA":"abc","appinfoB":123,"appinfoC":true},"device_id":3,"device_type":"accelerometer","id":6,"timestamp":"2003-09-26T07:22:09+0000"}
{"data":1.5,"device_id":1,"device_type":"temperature","id":7,"timestamp":"2000-05-11T21:20:53+0000"}
{"data":"I'm just a string","device_id":1,"device_type":"flow
@AlexMikhalev
AlexMikhalev / rust-xp-01-s3.rs
Created December 9, 2022 19:35 — forked from jeremychone/rust-xp-01-s3.rs
Rust Quick Example to connect to S3 and Minio bucket server
#![allow(unused)] // silence unused warnings while exploring (to comment out)
use std::{error::Error, str};
use s3::bucket::Bucket;
use s3::creds::Credentials;
use s3::region::Region;
use s3::BucketConfiguration;
// Youtube Walkthrough - https://youtu.be/uQKBW8ZgYB8
@AlexMikhalev
AlexMikhalev / graphql_api_rate.py
Created August 21, 2022 14:52
Check if user is sponsor and it's tier via Github GraphQL API with rate_limit
import requests
from datetime import datetime
import time
import os
github_token = os.getenv('GITHUB_TOKEN')
real_requests_post = requests.post
def wrap_requests_post(*args, **kwargs):
@AlexMikhalev
AlexMikhalev / app.py
Created August 8, 2022 08:24 — forked from xros/app.py
Use Github's OAuth/Account to Login Your Server -- Python/Flask Example
# github生成的两把钥匙
client_id = 'e3a53e8921975c37fe3d'
client_secret = '739a252f5022855aadcc832a2facd86b1b836ef6'
from flask import Flask, \
redirect, \
jsonify
from furl import furl
import requests
import json
from flask import request
@AlexMikhalev
AlexMikhalev / Pulumi.production.yaml
Created August 1, 2022 17:50 — forked from GavinRay97/Pulumi.production.yaml
Deploy Hasura on Fargate, including creating a Route53 Domain w/ Cert Manager certificate, and Load Balancer configured for HTTPS on new domain
config:
aws:region: us-east-2
my-project:HASURA_GRAPHQL_DATABASE_URL:
secure: <snipped>
@AlexMikhalev
AlexMikhalev / steve-yegge-google-platform-rant.md
Created July 27, 2022 16:28 — forked from kislayverma/steve-yegge-google-platform-rant.md
A copy (for posterity) of Steve Yegge's internal memo in Google about what platforms are and how Amazon learnt to build them

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't really have SREs and they make engineers pretty much do everything,

@AlexMikhalev
AlexMikhalev / fetch_pubmed.py
Created July 26, 2022 14:54
fetch_pubmed_notes.py
import requests
import json
db = 'pmc'
domain = 'https://www.ncbi.nlm.nih.gov/entrez/eutils'
nresults = 4
query = "depression"
retmode='json'
# standard query