Skip to content

Instantly share code, notes, and snippets.

View CAD97's full-sized avatar

Crystal Durham CAD97

View GitHub Profile
@CAD97
CAD97 / Animator.java
Last active December 9, 2016 15:41
Animation Test
import javax.swing.*;
import java.awt.*;
import java.awt.geom.Area;
import java.util.List;
/**
* Animate Polygons around on a Graphics object.
*
* @author Christopher Durham
* @date 11/25/2016
@CAD97
CAD97 / antlrbug.zip
Last active January 10, 2017 02:50
antlr/intellij-plugin-v4 disagrees with antlr/antlr4/antlr4-maven-plugin/ on `.tokens` location
<?import javafx.scene.control.TextField?>
<?import tornadofx.Field?>
<?import tornadofx.Fieldset?>
<?import tornadofx.Form?>
<Form xmlns="http://javafx.com/javafx/null" xmlns:fx="http://javafx.com/fxml/1">
<Fieldset>
<!--Field text=""-->
<Field>
<TextField/>
</Field>
@CAD97
CAD97 / README.md
Created April 20, 2018 22:51
I made a lazy slog

This is a potential crate that would simplify the use of the example-lib pattern for slog.

The motivation is the same as that of the example-lib: a library using slog for its logging would like to accept a parent logger if the crate pulling it in is using slog, or fall back to interfacing with log's static logger if not.

At any entry point to your library's interface, you would retrieve the Logger from your lazy slog. After that point, you would pass it around and create child loggers like normal.

@CAD97
CAD97 / octopath_traveler_skill_acquiry.json
Last active July 2, 2018 19:02
Octopath Traveler skill acquiry bingo goals
[
{ "name": "Ophilia" , "types": ["Ophilia"] },
{ "name": "Ophilia - Heal Wounds" , "types": ["Ophilia"] },
{ "name": "Ophilia - Holy Light" , "types": ["Ophilia"] },
{ "name": "Ophilia - Sheltering Veil" , "types": ["Ophilia"] },
{ "name": "Ophilia - Luminescence" , "types": ["Ophilia"] },
{ "name": "Ophilia - Heal More" , "types": ["Ophilia"] },
{ "name": "Ophilia - Reflective Veil" , "types": ["Ophilia"] },
{ "name": "Ophilia - Revive" , "types": ["Ophilia"] },
{ "name": "Cyrus" , "types": ["Cyrus"] },
@CAD97
CAD97 / current-expanded.rs
Created August 31, 2018 03:57
A Vision for Pest
// builtin derives collapsed and other cleanup applied manually
mod parser {
use pest::{
error::Error,
iterators::{Pair, Pairs},
Parser,
};
pub struct MyParser;
I am the Miaou user with id 6845 and name "cad97" on https://miaou.dystroy.org
@CAD97
CAD97 / notes.md
Last active April 10, 2023 22:52
Comments on the Proposed Rust Trademark Policy

Policy draft: https://docs.google.com/document/d/1ErZlwz9bbSI43dNo-rgQdkovm2h5ycuW220mWSOAuok/edit?usp=sharing Comment form: https://docs.google.com/forms/d/e/1FAIpQLSdaM4pdWFsLJ8GHIUFIhepuq0lfTg_b0mJ-hvwPdHa4UTRaAg/viewform

(Obvious) Disclaimer: The material in these notes have not been reviewed, endorsed, or approved of by the Rust Foundation, but they have been submitted and hopefully will be reviewed. The current policy can be seen here: https://foundation.rust-lang.org/policies/logo-policy-and-media-guide/

The comment, exactly as submitted, is reproduced below:


TL;DR: The proposed policy places significant new restrictions on the use of the Rust® name which are not present in the current policy. This extension to the policy is unnecessary and presupposes that a simple mention of the Rust® Programming Language could be misconstrued as implying endorsement from the Rust® Foundation.

@CAD97
CAD97 / dynit.rs
Created April 26, 2023 03:46
dynit, another experimental stable dyn*-alike
use std::future::Future;
use std::marker::PhantomData;
use std::ops::{Deref, DerefMut};
use std::pin::Pin;
use std::ptr::{drop_in_place, NonNull};
use std::task::{Context, Poll};
// example
fn main() {
@CAD97
CAD97 / coerce.rs
Created April 26, 2023 05:40
another coercion sketch
use std::future::Future;
use std::convert::Infallible;
#[derive(Debug, Copy, Clone)]
pub struct Coercion<T: ?Sized, U: ?Sized>(fn(*mut T) -> *mut U);
impl<T: ?Sized, U: ?Sized> Coercion<T, U> {
#[inline]
pub unsafe fn new(f: fn(*mut T) -> *mut U) -> Self {
Coercion(f)