Discover gists
This file contains hidden or 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
import java.io.File; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Stack; | |
import android.os.FileObserver; | |
/** | |
* A FileObserver that observes all the files/folders within given directory | |
* recursively. It automatically starts/stops monitoring new folders/files |
This file contains hidden or 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
# Refactor of: https://medium.com/@hebozhe/optimizing-levenshtein-distance-in-python-using-built-ins-only-8f6b37e9de89 | |
def calculate_distance_to_last_position(matching_positions: list[tuple[int, int]]) -> int: | |
''' | |
summary: Calculate the minimum distance from (0, 0) to the end of | |
a list of Levenshtein coordinates. | |
params: | |
coords: list[tuple[int, int]] of (row, column) coordinates where | |
the characters of two strings were identical. | |
return: int of the Levenshtein distance. |
This file contains hidden or 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
{ | |
"1": [], | |
"2": [], | |
"3": [ | |
"ул. Азгура - 1", | |
"ул. Азгура - 1а", | |
"ул. Азгура - 1б", | |
"ул. Азгура - 3", | |
"ул. Азгура - 5", | |
"ул. Андреевская - 7/2", |
This file contains hidden or 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
- name: Overprovision like the pros' | |
hosts: all | |
tasks: | |
- name: Install early OOM killer and zram | |
ansible.builtin.apt: | |
pkg: | |
- earlyoom | |
- zram-tools | |
- name: Configure early OOM killer | |
ansible.builtin.lineinfile: |
This file contains hidden or 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
<?php // Don't use this line. | |
/* | |
* Add the script below to wherever you store custom code snippets | |
* in your site, whether that's your child theme's functions.php, | |
* a custom plugin file, or through a code snippet plugin. | |
*/ | |
/** | |
* This function will connect wp_mail to your authenticated |
See how a minor change to your commit message style can make a difference.
git commit -m"<type>(<optional scope>): <description>" \ -m"<optional body>" \ -m"<optional footer>"