Skip to content

Instantly share code, notes, and snippets.

//
// VolumePopupView.swift
//
// Created by Alex Rosenberg on 1/24/24.
//
import SwiftUI
import AVFoundation
import MediaPlayer
//
// PagingView.swift
// Wallaroo - https://wallaroo.app
//
// Created by Sean Heber (@BigZaphod) on 8/9/22.
//
import SwiftUI
// This exists because SwiftUI's paging setup is kind of broken and/or wrong out of the box right now.
@IanKeen
IanKeen / Storage.swift
Last active April 8, 2024 12:24
PropertyWrapper: Storage to extend support for more types using `@AppStorage`
@propertyWrapper
struct Storage<T: AppStorageConvertible>: RawRepresentable {
var rawValue: String { wrappedValue.storedValue }
var wrappedValue: T
init?(rawValue: String) {
guard let value = T.init(rawValue) else { return nil }
self.wrappedValue = value
}
init(wrappedValue: T) {
@stek29
stek29 / dreame_1c_root.md
Last active March 2, 2024 12:38
Root Dreame Robot without via uart only

These are just my notes, and described process worked for me on my 1C robot
If anything goes wrong, having USB adapter for FEL flashing might be the only way to restore your robot
this is not an official guide
oh, and I'm not responsible for any damage blah blah
and huge thanks to Dennis and Hypfer, and everyone behind this root :)

0. get uboot shell

to enter uboot shell on 1C you have to: 0. turn robot off normally

  1. hook up uart, open console
@achanda
achanda / dotexec.md
Last active March 8, 2018 03:52
Dot execing Rust
  • Wrapper script
root@dev:~# cat `which rustwrap`
#!/usr/bin/env bash

rustc "$1" -o foobar && shift && ./foobar "$@"
  • Mount binfmt_misc
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc

systemd-nspawn container architecture

This short document will show how to turn systemd-nspawn into a usable containeration system.

Those instructions here should work under Arch Linux and Debian 10 (Buster)

Host requirements

  • systemd-nspawn and machinectl (systemd-container package under Debian)
  • dnsmasq
  • debootstrap
@marcan
marcan / smbloris.c
Last active November 22, 2022 08:32
SMBLoris attack proof of concept
/* SMBLoris attack proof-of-concept
*
* Copyright 2017 Hector Martin "marcan" <marcan@marcan.st>
*
* Licensed under the terms of the 2-clause BSD license.
*
* This is a proof of concept of a publicly disclosed vulnerability.
* Please do not go around randomly DoSing people with it.
*
* Tips: do not use your local IP as source, or if you do, use iptables to block
@marcan
marcan / gamma_trick.sh
Last active December 10, 2023 22:06
Two images in one using the PNG gamma header trick.
#!/bin/sh
# PNG Gamma trick (by @marcan42 / marcan@marcan.st)
#
# This script implements an improved version of the gamma trick used to make
# thumbnail images on reddit/4chan look different from the full-size image.
#
# Sample output (SFW; images by @Miluda):
# https://mrcn.st/t/homura_gamma_trick.png
# https://www.reddit.com/r/test/comments/6edthw/ (click for fullsize)
# https://twitter.com/marcan42/status/869855956842143744
@ttsiodras
ttsiodras / RustyThoughts.md
Last active September 8, 2020 08:17
Rusty thoughts on affine types

Below is my understanding of affine types and how they help us in Rust (unsure if I got this right - please correct if I am talking nonsense).

The issue is... How can we use the power of a type system so a compiler will block us from doing this wrong sequence of calls?

FILE *fp = NULL;
fclose(fp);
fp = fopen("...");

An idea is to "mirror" the states that the file variable goes through (unused/closed, opened) in the type system: