Skip to content

Instantly share code, notes, and snippets.

Artyom K artkpv

Block or report user

Report or block artkpv

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@artkpv
artkpv / latency.txt
Last active Jan 1, 2020 — forked from negrinho/latency.txt
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers Simplified (~2012)
---------------------------------- log2 log10
L1 cache reference 0 0 0.5 ns
Branch mispredict 3 1 5 ns
L2 cache reference 3 1 7 ns
Mutex lock/unlock 5 2 25 ns
Main memory reference 8 2 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 14 4 10,000 ns 10 us
Send 1K bytes over 1 Gbps network 14 4 10,000 ns 10 us
Read 4K randomly from SSD* 18 5 150,000 ns 150 us ~1GB/sec SSD
@artkpv
artkpv / setdns.cmd
Created Oct 11, 2017
Changes DNS servers for IPv4 or clears them to ISP's ones
View setdns.cmd
rem Changes DNS servers for IPv4 or clears them to ISP's ones
rem REQUIRES elevated access (Administrator)
rem see list at https://en.wikipedia.org/wiki/Public_recursive_name_server
@echo off
if [%1] equ [] wmic nicconfig where "(IPEnabled=TRUE)" call SetDNSServerSearchOrder ("")
if /I "%1"=="google" wmic nicconfig where "(IPEnabled=TRUE)" call SetDNSServerSearchOrder ("8.8.8.8","8.8.4.4")
@artkpv
artkpv / union_find.py
Last active Nov 20, 2019 — forked from SofiaGodovykh/union_find.py
Union-Find in Python (weighted, path compression, connected components)
View union_find.py
class UnionFind:
"""Weighted quick-union with path compression and connected components.
The original Java implementation is introduced at
https://www.cs.princeton.edu/~rs/AlgsDS07/01UnionFind.pdf
>>> uf = UnionFind(10)
>>> for (p, q) in [(3, 4), (4, 9), (8, 0), (2, 3), (5, 6), (5, 9),
... (7, 3), (4, 8), (6, 1)]:
... uf.union(p, q)
@artkpv
artkpv / pomodoro.ps1
Created Sep 18, 2017
Simple Powershell pomodoro timer with notification and logging
View pomodoro.ps1
function pomo {
# simple pomodoro timer:
# pomo [minutes]
param($minutes = 25)
$start = (get-date)
while ($true) {
$left = (get-date) - $start
if (($left.Minutes) -ge $minutes) { break }
[System.Console]::Out.Write("`r$($minutes - $left.Minutes)m left...")
sleep 3
@artkpv
artkpv / rocketpdftocsv.py
Last active Sep 16, 2019
Convert PDF to CSV for Rocketbank (Рокетбанк)
View rocketpdftocsv.py
#!/bin/python3
"""
Конвертирует транзакции Рокетбанка (https://rocketbank.ru) из PDF в CSV.
Выводит в UTF8.
Зависимости:
- Poppler. В PATH: 'pdftotext'
https://poppler.freedesktop.org/
https://jlk.fjfi.cvut.cz/arch/manpages/man/pdftotext.1
@artkpv
artkpv / UserStoreAdapter.cs
Created Jun 29, 2015
Isolating AspNet.Identity.EntityFramework
View UserStoreAdapter.cs
/*
* That adapter allows to isolate AspNet.Identity.EntityFramework
* assembly with its IdentityUser and other classes from
* AspNet.Identity.Core. It works with ApplicationUser that is not
* derived from IdentityUser.
* Author: w1ld at inbox dot ru
* Created: 2015 06 29
*/
using System.Collections.Generic;
using System.Diagnostics.Contracts;
@artkpv
artkpv / _viemurc
Created Aug 18, 2013
Viemu settings for Visual Studio 2012 and Resharper 7 under Visual C# 2005 keyboard scheme.
View _viemurc
"
"Originally taken from
"https://github.com/StanislawSwierc/Profile/blob/master/_viemurc
"
" ViEmu has access to all keys except the following:
" <C-c>
" <C-v>
"
You can’t perform that action at this time.