Skip to content

Instantly share code, notes, and snippets.

View GoldsteinE's full-sized avatar

Max “Goldstein” Siling GoldsteinE

View GitHub Profile
@GoldsteinE
GoldsteinE / t22.rs
Last active December 22, 2020 11:59
use std::collections::{HashSet, VecDeque};
use anyhow::Context as _;
pub type Card = usize;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Winner {
Player1,
Player2,
#!/usr/bin/env perl
use v5.18;
use strict;
our %rules;
sub compile_rule {
state %compiled;
#!/usr/bin/env perl
use v5.18;
use strict;
our %rules;
sub compile_rule {
state %compiled;
POP_TOP 1 0x1
ROT_TWO 2 0x2
ROT_THREE 3 0x3
DUP_TOP 4 0x4
DUP_TOP_TWO 5 0x5
ROT_FOUR 6 0x6
NOP 9 0x9
UNARY_POSITIVE 10 0xA
UNARY_NEGATIVE 11 0xB
UNARY_NOT 12 0xC
# pylint: disable=all
from __future__ import annotations
from typing import Callable, Generic, List, Optional, TypeVar, Union
T = TypeVar('T')
S = TypeVar('S')
R = TypeVar('R')
Transform = Callable[[T], S]
" Sections (use <Leader>s to quick jump to section)
" 1. Basic options [S_BASIC]
" 2. Plugins [S_PLUGINS]
" 3. Colors [S_COLORS]
" 4. Autocommands [S_AUTO]
" 5. Mappings [S_MAPPINGS]
" 6. Lightline [S_LIGHTLINE]
" 7. NeoMake [S_NEOMAKE]
" 8. LSP & similar things [S_LSP]
" 9. Firenvim (using NeoVim in browser) [S_FIRENVIM]
#![feature(prelude_import)]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std;
use std::rc::Rc;
pub struct Container<T>(Rc<T>);
#[automatically_derived]
#[allow(unused_qualifications)]
impl<T: ::core::clone::Clone> ::core::clone::Clone for Container<T> {
test.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <f>:
0: 8d 47 01 lea 0x1(%rdi),%eax
3: c3 retq
4: 66 66 2e 0f 1f 84 00 data16 nopw %cs:0x0(%rax,%rax,1)
#include <stdio.h>
#define IS_INT_LONG(N) _Generic((N), \
int: no_int, \
long int: yes_long, \
long long int: yes_long_long, \
default: no_no_int \
)()
void no_int() {
#include <stdio.h>
#define IS_INT_LONG(N) _Generic((N), \
int: no_int, \
long int: yes_long, \
long long int: yes_long_long, \
default: no_no_int \
)()
void no_int() {