Skip to content

Instantly share code, notes, and snippets.

View darconeous's full-sized avatar
🦀

Robert Quattlebaum darconeous

🦀
View GitHub Profile
@darconeous
darconeous / playground.rs
Last active July 2, 2019 01:55 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use futures::prelude::*;
use pin_utils::unsafe_pinned;
use std::ops::Deref;
use std::pin::Pin;
use std::sync::Arc;
/// A container for a single object with lifetime that is bound to that of an `Arc`.
/// This is useful for passing around boxed futures that have a lifetime that is limited
/// to that of the object that created it.
///
@darconeous
darconeous / playground.rs
Last active May 29, 2019 17:56 — forked from rust-play/playground.rs
Code shared from the Rust Playground
/// Demonstration of compile-time key-value type safety.
///
/// This program demonstrates how you use Rust generics to encode type
/// information into the keys for a key-value store. This allows for
/// type-safe access to data in the store, preventing things like writing
/// strings to keys that should only contain integers. Attempting to
/// do so results in a compile-time error.
///
/// The example code is at the top of this file, the implementation details
/// are below the example.
@darconeous
darconeous / playground.rs
Last active May 17, 2019 23:52 — forked from rust-play/playground.rs
Code shared from the Rust Playground
/// Demonstration of a way to do polymorphic property lookup of standardized
/// collections of properties via simple traits and getter methods. This
/// approach could be extended to do things like fetch a list of the supported
/// keys, or expose aritrary traits via a property interface.
/// This is the trait that will be our general-purpose property interface. It
/// is intended to be used as a trait object.
///
/// This trait is implemented automatically by the `impl_super_trait!` macro,
@darconeous
darconeous / secdebug.sh
Last active August 29, 2015 14:11 — forked from drewbug/secdebug
`securityd` debug logging #Security
# trace debug-log macro
sudo dtrace -qn 'security_debug*:::log { printf("[%s] %s\n", copyinstr(arg0), copyinstr(arg1)); }'
# restart securityd
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.securityd.plist &&
sudo launchctl load /System/Library/LaunchDaemons/com.apple.securityd.plist