Skip to content

Instantly share code, notes, and snippets.

@dvdvdmt
dvdvdmt / max_heap.py
Last active May 6, 2017 12:10
Max heap based on list
import heapq
# Max heap based on list
class MaxHeap(list):
def __init__(self, l):
super().__init__(l)
for i in range(self.parent(len(self)), -1, -1):
@dvdvdmt
dvdvdmt / min_heap.py
Last active May 6, 2017 15:09
Min heap based on list
import heapq
# Min heap based on list
class MinHeap(list):
def __init__(self, l):
super().__init__(l)
for i in range(self.parent(len(self)), -1, -1):
@dvdvdmt
dvdvdmt / Google image using the last screenshot.kmmacros
Created September 24, 2017 07:39
Keyboard maestro macro. Search image using last screenshot
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>CreationDate</key>
<real>527585774.25454998</real>
<key>Macros</key>
@dvdvdmt
dvdvdmt / wikipedia-clean-white-theme.css
Last active March 13, 2019 05:45
A CSS theme for Wikipedia for Stylish (https://userstyles.org/) Chrome extension
/* cyrillic-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v15/mem8YaGs126MiZpBA-UFWJ0bf8pkAp6a.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {