Skip to content

Instantly share code, notes, and snippets.

View azabost's full-sized avatar

Andrzej Zabost azabost

View GitHub Profile
@azabost
azabost / MutableLazy.kt
Created November 30, 2022 12:54
Kotlin mutable lazy delegate
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty
fun <T> mutableLazy(initializer: () -> T) = MutableLazy(initializer)
/**
* Lazy-like delegate but mutable.
*
* Inspired by [SynchronizedLazyImpl] and https://stackoverflow.com/a/47948047/6761823
*/
@azabost
azabost / slackmojis_downloader.py
Last active October 12, 2022 21:42 — forked from iam-mhaseeb/slackmojis_downloader.py
Slackmojis.com Downloader
import os
import sys
import requests
from bs4 import BeautifulSoup
def generate_filename(dest_dir, filename, count):
"""
:rtype: basestring
@azabost
azabost / GranularityTester.kt
Created February 6, 2018 22:58
Kotlin nanoTime granularity tests
package com.azabost.benchmarks.granularity
interface GranularityTester {
val measurements: Int
fun start()
}