Skip to content

Instantly share code, notes, and snippets.

View simmsb's full-sized avatar
💥
ghc: panic! (the 'impossible' happened)

Ben Simms simmsb

💥
ghc: panic! (the 'impossible' happened)
View GitHub Profile
use std::io::Write;
use std::net::Ipv6Addr;
use std::path::PathBuf;
use clap::Parser;
use image::{AnimationDecoder, Frame, GenericImageView, Pixel, Rgb};
use massping::packet::EchoRequestPacket;
use socket2::Domain;
#[derive(clap::Parser)]
@simmsb
simmsb / return_0.c
Last active October 13, 2022 23:46
#include <stdlib.h>
#include <string.h>
#include "base.h"
#include "builtin.h"
struct env_45 {struct obj *v_k_205;struct obj *v_while_202;struct obj *v_for_204;};
void lambda_45(struct obj *, struct obj *, struct env_obj *)__attribute__((noreturn)) ;
struct env_47 {struct obj *v_k_201;struct obj *v_rv_282;};
void lambda_47(struct obj *, struct env_obj *)__attribute__((noreturn)) ;
struct env_12 {struct obj *v_inner_232;struct obj *v_k_244;struct obj *v_it_241;struct obj *v_body_230;};
void lambda_12(struct obj *, struct obj *, struct env_obj *)__attribute__((noreturn)) ;
import pymesh
rules = """
""".strip().splitlines()
def parse_rule(r: str):
on, c = r.split(" ")
on = on == "on"
struct packet
{ char * pkt;
uint32_t idx;
};
struct JPv4_h
{ uint32_t dstAddr;
uint32_t srcAddr;
uint16_t hdrChecksum;
uint8_t protocol;
uint8_t ttl;
#include "base.h"
#include "builtin.h"
#include <stdlib.h>
#include <string.h>
struct env_34 {
struct obj *v_rv_448;
struct obj *v_k_447;
};
void lambda_34(struct obj *, struct env_obj *) __attribute__((noreturn));
@simmsb
simmsb / hehe.c
Created September 26, 2020 08:44
hehe
#include "base.h"
#include "builtin.h"
#include <stdlib.h>
#include <string.h>
struct env_24 {
struct obj *v_map_996;
struct obj *v_k_1030;
struct obj *v_f_1029;
};
@simmsb
simmsb / bot.py
Created August 20, 2020 22:36
Dame bot
import asyncio
import tempfile
import discord
from discord.ext import commands
from discord.ext.alternatives import asset_converter, literal_converter
from urllib.parse import urlparse
from typing import Literal
import os
@simmsb
simmsb / combinators.py
Created April 19, 2020 01:37
Parser combinators
from functools import wraps
from typing import Optional, Tuple, TypeVar, Callable, Coroutine, List, Any
NoneType = type(None)
class StringView:
def __init__(self, s: str, idx: int = 0):
self.s = s
self.idx = idx
self.end = len(s)
*** Exception (reporting due to +RTS -xc): (THUNK), stack trace:
GhcMod.Cradle.stackCradle,
called from GhcMod.Cradle.findCradle',
called from Control.Monad.Trans.Journal.runJournalT,
called from GhcMod.Monad.withGhcModEnv.withCradle,
called from GhcMod.Monad.withGhcModEnv',
called from GhcMod.Monad.withGhcModEnv,
called from GhcMod.Monad.Newtypes.>>=,
called from Control.Monad.Trans.Control.control,
called from Control.Monad.Trans.Control.liftBaseOp.\,
[Unit]
Description=sync org git
[Service]
Type=oneshot
ExecStart=/home/ben/dev/git-sync/git-sync
WorkingDirectory=/home/ben/org