- https://github.com/topics/spaced-repetition
- https://github.com/ap4y/leaf
- https://github.com/Networks-Learning/memorize (http://learning.mpi-sws.org/memorize/)
- https://github.com/fasiha/ebisu#how-it-works
- https://gist.github.com/fasiha/31ce46c36371ff57fdbc1254af424174
- https://pypi.org/project/django-memorize/
- https://gist.github.com/doctorpangloss/13ab29abd087dc1927475e560f876797
- https://github.com/theq629/fulgurate/blob/master/cards.py
- https://massimmersionapproach.com/table-of-contents/anki/low-key-anki/the-ease-factor-problem/
- https://mochi.cards/
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
import time | |
import logging | |
import collections | |
# Inspired by; https://tersesystems.com/blog/2019/07/28/triggering-diagnostic-logging-on-exception/ | |
# Also see; https://docs.python.org/3.6/library/logging.handlers.html#logging.handlers.MemoryHandler | |
# Also see; https://github.com/komuw/naz/blob/e0666550396400f86b9a547932bb9075c520a5d9/naz/log.py#L159-L230 | |
class BreachHandler(logging.StreamHandler): | |
""" | |
Log handler that buffers logs in an in-memory ring buffer until a trigger. |
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
import copy | |
# see: https://stackoverflow.com/questions/13260557/create-new-class-instance-from-class-method | |
class Animal(object): | |
request_id = "Original_Animal" | |
def reproduce(self): | |
""" | |
gives birth to new instances of Animal |
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
const std = @import("std"); | |
const warn = std.debug.warn; | |
pub fn main() !void { | |
// 1. This works | |
var buf = try std.Buffer.init(std.debug.global_allocator, ""); | |
defer buf.deinit(); | |
try buf.append("hello"); | |
warn("buffer:\n\t {}", buf); |
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
const std = @import("std"); | |
const os = std.os; | |
const warn = std.debug.warn; | |
pub fn main() !void { | |
var file = try os.File.openRead("/path/to/file.txt"); | |
defer file.close(); | |
const file_size = try file.getEndPos(); | |
// why cant I use? |
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
import asyncio | |
import collections | |
class Iterable: | |
def __init__(self, my_list): | |
self.pool = collections.deque(my_list, maxlen=None) | |
self.len = len(self.pool) | |
self.index = 0 |
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
package main | |
import ( | |
"bytes" | |
"io" | |
"log" | |
"net" | |
"time" | |
) |
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
import asyncio | |
import requests | |
import concurrent | |
import functools | |
loop = asyncio.get_event_loop() | |
def reqq(timeout): |
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
import os | |
import errno | |
import time | |
""" | |
The linux pipe buffers are implemnted as circular buffers[1]. | |
A consequence of the circular buffer is that when it is full and a subsequent write is performed: | |
(a) then it starts overwriting the oldest data[2]. | |
(b) Alternatively, the routines that manage the buffer could prevent overwriting the data and return an error or raise an exception. |
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
package main | |
// or just use: | |
// 1. https://github.com/uber-go/goleak | |
// 2. github.com/cockroachdb/cockroach/pkg/util/leaktest | |
import ( | |
// "bytes" | |
"fmt" | |
"os" |