Skip to content

Instantly share code, notes, and snippets.

@fortuna
fortuna / merge_results.tsv
Last active December 28, 2024 12:29
Analysis of blocking in Russia. All entries in one table.
strategy server_net server_port isp url_scheme exit_code img error
$key Digital Ocean 443 Bee Line Cable http 0
$key Digital Ocean 443 Bee Line Cable https 0
$key Digital Ocean 443 MTS PJSC http 28 curl: (28) Operation timed out after 10006 milliseconds with 0 bytes received
$key Digital Ocean 443 MTS PJSC https 28 curl: (28) Connection timed out after 10005 milliseconds
$key Digital Ocean 443 PJSC MegaFon http 0
$key Digital Ocean 443 PJSC MegaFon https 56 curl: (56) Failure when receiving data from the peer
$key Digital Ocean 443 Tele2 Russia http 0
$key Digital Ocean 443 Tele2 Russia https 0
$key Digital Ocean 5555 Bee Line Cable http 0
@HananoshikaYomaru
HananoshikaYomaru / fix.css
Last active April 21, 2025 19:15
life calendar in obsidian using dataview js
/* wide */
.wide .markdown-preview-sizer {
max-width: unset !important;
}
.life-calendar p a.internal-link {
display: inline-block;
}

WSL 2 with CUDA

Set up Windows Subsystem for Linux (version 2) with CUDA support + TensorFlow.

Before you start

  • You must be on Windows 10 21H2 or above.

    Note: On my system 21H2 could not be updated to. I ended up with a bricked install as Windows tried to install Windows 11 on my unsupported CPU. I recommend just installing Windows 10 21H2 directly from an ISO.

  • You don't have to be on OS build 20140 or above as some sources state. My build: 19044.1469
  • Install the latest "game ready driver" for your card.

XIX Задача о поиске элемента ⭐⭐

Дан упорядоченный массив чисел размером N Нужно реализовать алгоритм поиска вхождения упорядоченного подмассива размера M, где M << N

func isInclude(array int[], subarray []int) bool

assert(isInclude([1, 2, 3, 5, 7, 9, 11], []) == true) 
assert(isInclude([1, 2, 3, 5, 7, 9, 11], [3, 5, 7]) == true) 
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@staltz
staltz / introrx.md
Last active April 24, 2025 06:10
The introduction to Reactive Programming you've been missing
func partition<C: Comparable>(v: C[], left: Int, right: Int) -> Int {
var i = left
for j in (left + 1)..(right + 1) {
if v[j] < v[left] {
i++
(v[i], v[j]) = (v[j], v[i])
}
}
(v[i], v[left]) = (v[left], v[i])
return i
@mderazon
mderazon / mongo-dump-csv.sh
Last active November 3, 2022 16:18
Export all of Mongodb collections as csv without the need to specify fields
OIFS=$IFS;
IFS=",";
# fill in your details here
dbname=DBNAME
user=USERNAME
pass=PASSWORD
host=HOSTNAME:PORT
# first get all collections in the database
@oban89
oban89 / Chrome URL to Reminders
Created April 11, 2013 18:13
Bookmarklets to add he current browser page to Reminders app via Drafts for iOS.
javascript:window.location='drafts://x-callback-url/create?text='+encodeURIComponent(document.title+'\n')+encodeURIComponent(location.href)+'&action=Reminder&x-success=googlechrome://';
@rvagg
rvagg / README.md
Last active February 24, 2025 11:41
Kindleberry "Paperwhite" Pi

Work in progress, I'll write this up properly when I'm done.

Almost all credit goes to @maxogden for putting me on to this and pointing me in the right direction for each of these items.

Prerequisites:

  • Raspberry Pi
  • Kindle Paperwhite freed from its locked down state (jailbroken) http://www.mobileread.com/forums/showthread.php?t=198446
    • You have to downgrade your Kindle to 5.3.1 to install the current jailbreak; that's just a matter of getting the old version image, putting it on your Kindle via USB and telling it to install "upgrade". Then you put in the Jailbreak files, load the ebook and break.
  • Your kindle will be quick to detect an upgrade is available so it'll want to upgrade soon afterwards but the jailbreak will last but you have to reinstall the developer certificates so it's a bit of a pain but doable. Find all the instructions on the mobileread.com forums and wiki.