I hereby claim:
- I am stevebrun on github.
- I am sbrun (https://keybase.io/sbrun) on keybase.
- I have a public key ASDdAuz7l8NXr4dTieWLCCHVHVrxezxED0cYXn5kPvymyAo
To claim this, I am signing this object:
#include "iexp.h" | |
#include <float.h> | |
#include <math.h> | |
#include <stddef.h> | |
// https://stackoverflow.com/questions/7812044/finding-trailing-0s-in-a-binary-number/36791297#36791297 | |
// Manually get two's compliment with (~integer + 1) instead of arithmatic | |
// negation because signed integer representation is implementation-defined | |
// behavior, so we can't always assume that negative integers are represented | |
// with two's complement instead of one's complement or signed magnitude. |
// | |
// ConstantClass.m | |
// | |
// An example for how to create compile-time constant Objective-C objects that | |
// can be assigned to any static const variable. | |
// | |
// Compile with -fno-objc-arc to allow overriding of retain/release methods. | |
// | |
#import <Foundation/Foundation.h> |
#!/bin/bash | |
## | |
## Launch Firefox from Steam Deck's "Gaming Mode". | |
## | |
## Although it doesn't provide a perfect browsing experience, this script | |
## at least makes sure that menus and windows appear as they're supposed to. | |
## | |
## INSTRUCTIONS: | |
## | |
## - Save this file to the ~/.local/bin directory. |
#!/bin/bash | |
# | |
# Launch Steam Desk's "Desktop Mode" from within "Gaming Mode". | |
# https://www.reddit.com/r/SteamDeck/comments/wycp1r/comment/ilw1cov/ | |
# https://www.reddit.com/user/FineWolf/ | |
# Friday, August 26, 2022 | |
# | |
# Commented by Steven Brunwasser | |
# Sunday, October 23, 2022 | |
# |
#!/usr/bin/env swift | |
// | |
// Copyright 2021 Steven Brunwasser | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy of | |
// this software and associated documentation files (the "Software"), to deal in | |
// the Software without restriction, including without limitation the rights to use, | |
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the | |
// Software, and to permit persons to whom the Software is furnished to do so, | |
// subject to the following conditions: |
I hereby claim:
To claim this, I am signing this object:
struct CycleIterator<Element>: IteratorProtocol, ExpressibleByArrayLiteral { | |
private var elements: [Element] | |
private var offset: Int = 0 | |
init(_ elements: [Element]) { | |
self.elements = elements | |
} | |
init(arrayLiteral elements: Element...) { | |
self.init(elements) |
import Foundation | |
struct Zip3Sequence<Sequence1, Sequence2, Sequence3>: Sequence | |
where Sequence1: Sequence, Sequence2: Sequence, Sequence3: Sequence { | |
typealias Element = Iterator.Element | |
typealias Iterator = Zip3Iterator<Sequence1.Iterator, Sequence2.Iterator, Sequence3.Iterator> | |
private var s1: Sequence1 | |
private var s2: Sequence2 | |
private var s3: Sequence3 |
#include <stdio.h> | |
#include <assert.h> | |
/// Count the amount of bytes contained within a null-terminated string. | |
/// - returns: The amount of bits before the null-terminator in the given string. | |
int string_length(char const *const string); | |
/// Reverse an array of bytes in-place. | |
/// - parameter bytes: A buffer of bytes to be reversed. | |
/// - parameter length: The amount of bytes contained within the buffer that should be reversed. |
/// - note: The equivalence operators don't work because `NSObject` implements `Equatable`. | |
import UIKit | |
// MARK: Constraint From Anchor | |
public func == <AnchorType>(constrained: NSLayoutAnchor<AnchorType>, reference: NSLayoutAnchor<AnchorType>) -> NSLayoutConstraint { | |
return constrained.constraint(equalTo: reference) | |
} |