This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro_rules! cold { | |
($expr:expr) => {{ | |
#[cold] | |
#[inline(always)] | |
fn __cold() {} | |
__cold(); | |
$expr | |
}} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![allow(dead_code)] | |
use std::ops::Add; | |
fn main() { | |
check_if_a::<_A>(); | |
check_if_a::<_B>(); | |
check_if_a::<_C>(); | |
type T1<'a> = Cons<'a, _A, Cons<'a, _B, Cons<'a, _C, ()>>>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::marker::PhantomData; | |
use std::panic; | |
use std::sync::Once; | |
fn main() { | |
for _ in 0..3 { | |
println!("RUNNING STATE MACHINE"); | |
println!("====================="); | |
run_state_machine((), beginning_state); | |
println!(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::any::type_name; | |
use std::marker::PhantomData; | |
use std::ops::Index; | |
macro_rules! sbytes { | |
() => { () }; | |
($head:expr $(,)?) => { | |
Byte<$head, ()> | |
}; | |
($head:expr, $($tail:expr),* $(,)?) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO: set constraints in no. of bits allowed. currently it's possible to crash a program with invalid bitfield sizes | |
use std::alloc::{alloc, dealloc, Layout, LayoutError}; | |
use std::ops::Drop; | |
use std::ptr::NonNull; | |
fn main() { | |
let mut ptr: FlagPointer<2, _> = FlagPointer::new(1234).unwrap(); | |
println!("value before set = {}", ptr.as_ref()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void lol_ganda_merda(void) | |
{ | |
int cenas = 0; | |
static void *labels[] = {&&tas_fodido}; | |
tas_fodido: | |
puts("bruh"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# get git-signify from: https://github.com/sug0/git-signify | |
set -e | |
printf 'Sign commit (y/n)? ' | |
read -sk yn | |
echo $yn | |
case $yn in | |
y|Y) | |
_commit=$(git rev-parse HEAD) | |
for i in {1..3}; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![allow(dead_code)] | |
use std::cell::UnsafeCell; | |
use std::mem::MaybeUninit; | |
use std::ops::Drop; | |
use std::sync::atomic::{AtomicUsize, Ordering}; | |
use std::sync::Arc; | |
use arc_swap::ArcSwap; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::pin::Pin; | |
use std::ops::ControlFlow; | |
use syn; | |
use quote; | |
/// Stackless generator, with no internal data stored | |
/// in itself. | |
pub trait Generator { | |
/// Data persisted across yield points, as well as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
main() { | |
parse_args $@ | |
capture_screen | |
} | |
parse_args() { |
NewerOlder