Skip to content

Instantly share code, notes, and snippets.

Martin Wernstål m4rw3r

Block or report user

Report or block m4rw3r

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@m4rw3r
m4rw3r / Vella Gear Guide.md
Last active Aug 29, 2015
Vindictus Vella Gear guide
View Vella Gear Guide.md

Vindictus Vella Gear Guide

This guide is slightly opinionated, as it is influenced by my own playstyle as well as the opinions of people I play with on "how to play the game". Therefore DEF is usually not prioritized, though I will try to provide decent alternatives which provide more defense without sacrificing too much in the offensive department.

Most of the sets listed here will force you to diversify your armor-proficiencies, as there is no set-combination listed here which is of only one armor-type.

Credits go to NaygetivReign for providing the original Sword Vella gear guide and also for teaching me the game.

View parser_combinator.rs
trait Source<'a> {
fn get(&mut self) -> Option<u8>;
fn mark(&self) -> &'a [u8];
fn restore(&mut self, &'a [u8]);
}
struct Slice<'a>(&'a [u8]);
impl<'a> Source<'a> for Slice<'a> {
fn get(&mut self) -> Option<u8> {
View parser_combinator2.rs
mod parser {
use std::fmt::Debug;
#[derive(Debug)]
pub enum Error<T> {
DidNotSatisfy(T)
}
#[derive(Debug)]
enum State<T, E> {
@m4rw3r
m4rw3r / parser_attoparsec_example_nom.rs
Last active Aug 29, 2015
Version of the attoparsec benchmark for parsing HTTP header dumps writtien in rust for the nom parser library.
View parser_attoparsec_example_nom.rs
#[macro_use]
extern crate nom;
use nom::IResult;
use std::env;
use std::fs::File;
#[derive(Debug)]
struct Request<'a> {
method: &'a [u8],
@m4rw3r
m4rw3r / parser_attoparsec_example.rs
Last active Aug 29, 2015
Version of the attoparsec benchmark for parsing HTTP header dumps writtien in rust using my experimental parser combinator.
View parser_attoparsec_example.rs
extern crate parser;
use parser::{Parser, Error};
use std::fs::File;
use std::env;
#[derive(Debug)]
struct Request<'a> {
method: &'a [u8],
@m4rw3r
m4rw3r / expanded_parser.rs
Last active Aug 29, 2015
Macros expanded in the parser.
View expanded_parser.rs
Compiling my_own v0.1.0 (file:///Users/m4rw3r/Desktop/attoparsec/examples/my_own)
#![feature(no_std)]
#![no_std]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std as std;
#[macro_use]
extern crate parser;
@m4rw3r
m4rw3r / parser_attoparsec_example2.rs
Last active Aug 29, 2015
Second version of the attoparsec benchmark for parsing HTTP header dumps writtien in rust using my experimental parser combinator.
View parser_attoparsec_example2.rs
//! http parser comparable to the http-parser found in attoparsec's examples.
//!
//! Reads data in the following format:
//!
//! ```text
//! GET /robot.txt HTTP/1.1
//! Host: localhost
//! Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
//!
//! ```
@m4rw3r
m4rw3r / http_parser.rs.diff
Created Aug 18, 2015
Difference between manually threading state and boxed closures in a piece of code using a parser-combinator.
View http_parser.rs.diff
diff --git a/examples/http_parser.rs b/examples/http_parser.rs
index 5c31b35..196763e 100644
--- a/examples/http_parser.rs
+++ b/examples/http_parser.rs
@@ -41,17 +41,17 @@ fn is_not_space(c: u8) -> bool { c != b' ' }
fn is_end_of_line(c: u8) -> bool { c == b'\r' || c == b'\n' }
fn is_http_version(c: u8) -> bool { c >= b'0' && c <= b'9' || c == b'.' }
-fn end_of_line<'a>(p: Empty<'a, u8>) -> Parser<'a, u8, u8, Error<u8>> {
- or(mdo!{p,
@m4rw3r
m4rw3r / combine_http_parser.rs
Created Aug 20, 2015
Version of the attoparsec example using the parser combinator Combine.
View combine_http_parser.rs
extern crate combine;
use combine::*;
use std::fs::File;
use std::env;
// Seems like combine does not support any kind of zero-copy parsing
#[derive(Debug, Clone)]
struct Request {
@m4rw3r
m4rw3r / combine_http_parser-pre.rs
Last active Aug 29, 2015
Version of the attoparsec http-header example for pre-release version of Combine.
View combine_http_parser-pre.rs
extern crate combine;
use combine::*;
use combine::combinator::{take_while1, range};
use combine::primitives::Error;
use std::fs::File;
use std::env;
You can’t perform that action at this time.