This is the resource repositry for my memory managment lecture / workshop series at Breda University of applied sciences - Games. It is mainly targeted for game developers
Discover gists
fun <T> Flow<T>.throttle(waitMillis: Int) = flow { | |
coroutineScope { | |
val context = coroutineContext | |
var nextMillis = 0L | |
var delayPost: Deferred<Unit>? = null | |
collect { | |
val current = SystemClock.uptimeMillis() | |
if (nextMillis < current) { | |
nextMillis = current + waitMillis |
Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.
- The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.
Translations: (No guarantee that the translations are up-to-date)
We can get list of changed files between 2 branches/commits by
$ tar --ignore-failed-read -vczf archive.tgz $(git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT master develop)
Let's see important part:
git diff-tree -r $commit_id
:
Take a diff of the given commit to its parent(s) (including all subdirectories, not just the top directory).
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
const std = @import("std"); | |
const Signer = std.crypto.sign.Ed25519; | |
// Blake3 : 1 | |
// Blake2b512 : 1.3 x slower than Blake3 | |
// Sha256 : 4 x slower than Blake3 | |
//const Hasher = std.crypto.hash.sha2.Sha256; | |
//const Hasher = std.crypto.hash.blake2.Blake2b512; | |
const Hasher = std.crypto.hash.Blake3; |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.