This file contains 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 bytes::BytesMut; | |
use cobs::{decode_vec_with_sentinel, encode_with_sentinel, max_encoding_length}; | |
use tokio::codec::{Decoder, Encoder}; | |
enum CobsCodecError { | |
MaxEncodeBufferSizeExceeded, | |
MaxDecodeBufferSizeExceeded, | |
CobsDecodingError, | |
IoError(::std::io::Error), | |
} |
This file contains 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
function diary() { | |
root="$HOME/Documents/journal" | |
date="$(date -u +"%Y/%m/%d")" | |
dir="$root/$date" | |
name="$(date -u +"%T")" | |
if [ ! -z "$1" ]; then | |
name+=" '$1'" | |
fi |
This file contains 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
fn main(){(|a|print!("{}({:?})}}",a,a))("fn main(){(|a|print!(\"{}({:?})}}\",a,a))")} |
This file contains 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
data:text/html, <html contentEditable=true style="caret-color: transparent; color: white; background-color: black;"><head><link rel="shortcut icon" href="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=" type="image/gif"><title>Black</title> |
This file contains 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
"dein Scripts----------------------------- | |
if &compatible | |
set nocompatible " Be iMproved | |
endif | |
" Required: | |
set runtimepath^=/home/meyer/.config/nvim/repos/github.com/Shougo/dein.vim,/nix/store/zan6v7jn67dz3m2axnarvx2k1gxv0dah-neovim-0.1.3/share/nvim/runtime | |
" Required: | |
call dein#begin(expand('/home/meyer/.config/nvim')) |
This file contains 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
<html> | |
<head> | |
<meta charset="utf-8"> | |
<link href="style.css" rel="stylesheet"> | |
</head> | |
<body> | |
<nav class="topbar"> | |
<ol class="path"> | |
<li class="directory"> | |
<span class="slash">/</span> |
This file contains 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
struct MemoryDB { | |
db: HashMap<ThreadID, (ThreadBody, Vec<PostBody>)>, | |
} | |
impl Database for MemoryDB { | |
fn get_threads(&self) -> Vec<Thread> { | |
self.db.iter().map( |(&thread_id, &(body, _))| Thread{id: thread_id, body: body} ).collect() | |
} | |
fn get_posts(&self, thread_id: ThreadID) -> Option<Vec<Post>> { |
This file contains 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
#![feature(macro_rules)] | |
macro_rules! alternative( | |
($in_expr:expr, $pat:pat, $out_true_expr:expr, $out_false_expr:expr) => ( | |
match $in_expr { | |
$pat => $out_true_expr, | |
_ => $out_false_expr, | |
} | |
); | |
) |
This file contains 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
//Counts the number of (non-overlapping) elements matching at the start and end of each slice | |
fn common_affix<E: TotalEq>(old: &[E], new: &[E]) -> (uint, uint) { | |
let shorter = min(old.len(), new.len()); | |
let mut common_prefix = 0; | |
for i in range(0, shorter) { | |
if old.get(i) != new.get(i) { | |
break; | |
} | |
common_prefix += 1; |
This file contains 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
.PHONY : all | |
all: thiscrate | |
.PHONY : thiscrate | |
thiscrate: libothercrate | |
rustc -L . -O main.rs | |
.PHONY : libothercrate | |
libothercrate: |
NewerOlder