This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" | |
"Originally taken from | |
"https://github.com/StanislawSwierc/Profile/blob/master/_viemurc | |
" | |
" ViEmu has access to all keys except the following: | |
" <C-c> | |
" <C-v> | |
" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python3 | |
from sys import argv, stderr | |
from os import path, chdir | |
from datetime import date | |
from subprocess import check_output | |
from re import sub, search | |
chdir(path.dirname(__file__)) | |
HFILE = '../all.ledger' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATE=02/03/2002 | |
CURR=USD | |
export LANG=ru_RU.CP1251 | |
curl 'http://www.cbr.ru/scripts/XML_daily.asp?date_req='$DATE -s | grep -Po $CURR'.*?Value>[^<]*' | sed -En -e 's/.*>([0-9,]*)/\1/gp' - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly. | |
https://beta.openai.com/playground/p/XUztlJ63iO3tyk3JnxePVTiW?model=text-davinci-002 | |
Human: Hello, who are you? | |
AI: I am an AI created by OpenAI. How can I help you today? | |
Human: Do you know where are you now? | |
AI: | |
I am in San Francisco, CA. | |
Human: But what particular place are you there? |
OlderNewer