Skip to content

Instantly share code, notes, and snippets.

View Kimundi's full-sized avatar

Marvin Löbel Kimundi

  • Dortmund, Germany
View GitHub Profile
@Kimundi
Kimundi / playground.rs
Created December 10, 2018 14:41 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use std::alloc::{GlobalAlloc, System, Layout};
use std::sync::atomic::{AtomicIsize, Ordering};
struct AllocationTracker {
mem: AtomicIsize
}
impl AllocationTracker {
const fn new() -> Self {
AllocationTracker {
@Kimundi
Kimundi / -
Last active December 19, 2017 10:42 — forked from anonymous/-
5da87b4de18456eead23ae3ab16a8d26 ./commoncrawl_10240.both
20db69984813a69e97c5d7fc4de6dcc9 ./commoncrawl_10240.all
6c4bc638e1cd757be7b19cca64a507a6 ./commoncrawl.ascii
7a98cf765251c47bda29924daa3cee78 ./data-web-snippets.tar.gz
5f13acc73540806180f260a1c3a10ebd ./commoncrawl_10240.non_ascii
cac07d752e129473c08021ac5ee21130 ./rlzap_dlcp_female
9164eeb0c8b694e499c43eef904bea56 ./news.gz
2adca0e60af3957c3879aad58c0bfba5 ./commoncrawl_null.ascii
2f04ea4ce678cabdc91974fea6bdb338 ./wiki-annot30.gz
c27275e1837b332043a0f1cf77cb5cfd ./wiki-disamb30.gz
@Kimundi
Kimundi / playground.rs
Created April 3, 2017 15:49 — forked from anonymous/playground.rs
Shared via Rust Playground
#![feature(specialization)]
use std::fmt::*;
trait Maybe<T: ?Sized> {
fn implements_this(&self) -> bool;
fn fmt(&self, &mut Formatter) -> Result;
}
macro_rules! impl_maybe {
@Kimundi
Kimundi / playground.rs
Created November 13, 2016 14:35 — forked from anonymous/playground.rs
Shared via Rust Playground
use std::mem;
use std::cell::Cell;
fn ref_as_cell<T: Copy>(t: &mut T) -> &Cell<T> {
unsafe { mem::transmute(t) }
}
fn slice_as_cell<T: Copy>(t: &mut [T]) -> &[Cell<T>] {
unsafe { mem::transmute(t) }
}
@Kimundi
Kimundi / github-pandoc.css
Created September 5, 2016 14:03 — forked from dashed/github-pandoc.css
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
@Kimundi
Kimundi / debug_or.rs
Created June 10, 2016 21:40 — forked from anonymous/playground.rs
Debug or
#![feature(specialization)]
macro_rules! debug_or {
($e:expr, $s:expr, $($a:expr),*) => {
$e.debug_or_else(|f| write!(f, $s, $($a),*))
};
($e:expr, $s:expr) => {
debug_or!($e, $s,)
}
}
@Kimundi
Kimundi / playground.rs
Created September 19, 2015 15:44 — forked from anonymous/playground.rs
Shared via Rust Playground
#![feature(unsize)]
#![feature(raw)]
#![feature(const_fn)]
#![feature(unique)]
use std::marker::{Unsize, PhantomData};
use std::fmt::Display;
use std::raw::TraitObject;
use std::mem;
use std::ops::Deref;
@Kimundi
Kimundi / playground.rs
Created September 19, 2015 15:18 — forked from anonymous/playground.rs
Shared via Rust Playground
#![feature(unsize)]
#![feature(raw)]
#![feature(const_fn)]
use std::marker::{Unsize, PhantomData};
use std::fmt::Display;
use std::fmt::Debug;
use std::raw::TraitObject;
use std::cell::Cell;
use std::mem;
@Kimundi
Kimundi / playground.rs
Created September 19, 2015 15:14 — forked from anonymous/playground.rs
Shared via Rust Playground
#![feature(unsize)]
#![feature(raw)]
#![feature(const_fn)]
use std::marker::{Unsize, PhantomData};
use std::fmt::Display;
use std::fmt::Debug;
use std::raw::TraitObject;
use std::cell::Cell;
use std::mem;
@Kimundi
Kimundi / playground.rs
Created September 19, 2015 14:42 — forked from anonymous/playground.rs
Shared via Rust Playground
#![feature(unsize)]
#![feature(raw)]
#![feature(const_fn)]
use std::marker::{Unsize, PhantomData};
use std::fmt::Display;
use std::fmt::Debug;
use std::raw::TraitObject;
use std::cell::Cell;
use std::mem;