use tokio::{runtime::Builder, sync::{mpsc}}; | |
use winit::{event::{Event, WindowEvent}, event_loop::{ControlFlow, EventLoop}, window::{Window, WindowBuilder}}; | |
pub struct Gpu { | |
pub surface: wgpu::Surface, | |
pub device: wgpu::Device, | |
pub queue: wgpu::Queue, | |
pub sc_desc: wgpu::SwapChainDescriptor, | |
pub swap_chain: wgpu::SwapChain, |
This guide will use either a macOS or an ArchLinux base system, to prepare a microSD card with Arch Linux for Raspberry Pi.
If someone managed to do the initial setup using Windows, please let me know, so I can add to this guide.
This guide will be verbose at times for some simple tasks. This is intended to help people just starting out, so it's not confusing. If something confuses you, let me know and I'll try my best to answer it.
const PLUGIN_NAME = "MutateRuntimePlugin"; | |
class MutateRuntimePlugin { | |
/** | |
* | |
* @param {FederationDashboardPluginOptions} options | |
*/ | |
constructor(options) {} | |
/** |
Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
any
: magic, ill-behaved type that acts like a combination ofnever
(the proper [bottom type]) andunknown
(the proper [top type])- Anything except
never
is assignable toany
, andany
is assignable to anything at all. - Identities:
any & AnyTypeExpression = any
,any | AnyTypeExpression = any
- Key TypeScript feature that allows for [gradual typing].
- Anything except
unknown
: proper, well-behaved [top type]- Anything at all is assignable to
unknown
.unknown
is only assignable to itself (unknown
) andany
. - Identities:
unknown & AnyTypeExpression = AnyTypeExpression
,unknown | AnyTypeExpression = unknown
- Anything at all is assignable to
- Prefer over
any
whenever possible. Anywhere in well-typed code you're tempted to useany
, you probably wantunknown
.
Hi, I'm mcpower. I've done Advent of Code seriously for two years now in Python, placing 9th in 2018 and 12th in 2017. This year, I'm taking a break from aiming for the leaderboard - while it's fun and all, it is a bit stressful at times (the good kind of stress, though!). As such, I'd like to share a few tips for anyone wanting to aim for the leaderboard.
This is everything that worked for me. Your mileage may vary, though - don't take this as gospel, see what works for you.
Go fast.
import { of, Subject, Observable, OperatorFunction } from 'rxjs'; | |
import { delay, tap, map, flatMap, mergeScan, reduce, finalize } from 'rxjs/operators'; | |
/** | |
* Over-time loader. This pipeline can be attached to a non-ending observable, though, you can't rely | |
* on the `finalize()` operator for checking if the loading is done or not. | |
* The observables you supply into it should be completeable. | |
* | |
* This can be extremely useful when you want that each of the 'loader' start as soon as possible, but still keep | |
* track of the progress. At the last `tap()` you can always see when one loader finishes that how many observables |