Skip to content

Instantly share code, notes, and snippets.

View nikitml's full-sized avatar

Nikita Lozhnikov nikitml

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nikitml
nikitml / solutions.ipynb
Created July 30, 2018 09:03
challenges
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nikitml
nikitml / codechallenge.ipynb
Last active August 6, 2018 22:12
codechallenge
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nikitml
nikitml / test.py
Created July 12, 2020 13:55
Timeit redis vs disk 10mb file store
from redis import Redis
from timeit import timeit
r = Redis('redis')
def blob(m=10):
return '1' * 1024 * 1024 * m
f10mb = blob(10)
@nikitml
nikitml / delete-brave-passwords.js
Created August 10, 2021 13:53
Mass delete saved passwords in Brave Browser (v1.26.74 macOS 15)
// On the page brave://settings/passwords open js console
// Select the final password row (to count how many there're, in my case it was 63)
// Update the script below and run
for (i = 1; i < 64; i++) {
document.querySelector("body > settings-ui").shadowRoot.querySelector("#main").shadowRoot.querySelector("settings-basic-page").shadowRoot.querySelector("#advancedPage > settings-section.expanded > settings-autofill-page").shadowRoot.querySelector("#passwordSection").shadowRoot.querySelector("#passwordsListHandler > div > div.cr-separators.list-with-header > password-list-item:nth-child(" + i +")").shadowRoot.querySelector("#moreActionsButton").click();
document.querySelector("body > settings-ui").shadowRoot.querySelector("#main").shadowRoot.querySelector("settings-basic-page").shadowRoot.querySelector("#advancedPage > settings-section.expanded > settings-autofill-page").shadowRoot.querySelector("#passwordSection").shadowRoot.querySelector("#passwordsListHandler").shadowRoot.querySelector("#menuRemovePass
@nikitml
nikitml / chrome_remove_passwords.js
Last active September 17, 2021 09:47
Attempts to remove all saved passwords in chrome
// Tested in Chrome 93
//
// Open `chrome://settings/passwords` and paste the snippet in the console and hit Enter
// It may my required to repeat the process a few times as I don't know JS
// and `.click()` seems to be async so not every button get clicked
n = document.querySelector("body > settings-ui").shadowRoot.querySelector("#main").shadowRoot.querySelector("settings-basic-page").shadowRoot.querySelector("#basicPage > settings-section.expanded > settings-autofill-page").shadowRoot.querySelector("#passwordSection").shadowRoot.querySelector("#passwordsListHandler > div > div.cr-separators.list-with-header").children.length
for (i = 1; i < n; i++) {