Skip to content

Instantly share code, notes, and snippets.

View skade's full-sized avatar
💭
Bringing Rust to safety critical.

Florian Gilcher skade

💭
Bringing Rust to safety critical.
View GitHub Profile
trait Query<'a, 'b: 'a, X: 'b, Y: 'a> {
fn execute(&self, f: X) -> Y;
}
#[derive(Default)]
struct ToBeQueried {
inner: String
}
struct GetInnerSlice;
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
def f0r(init, condition, step, &block)
var, step = *step
while condition[var]
eval "i = #{var}", block.binding
yield
var = step[var]
end
end
fn main() {
let mut test = "foobar".chars().
let mut test = test.skip(2);
println!("{}", test.as_str());
}
@skade
skade / function_to_copy.rs
Last active November 2, 2015 09:47
stuff to copy
fn handle(mailbox: &mut Mailbox, stream: &mut TcpStream) {
let message = read_message(stream);
match message.trim() {
"READ" => {
let maybe_mail = mailbox.get_mail();
if let Some(mail) = maybe_mail {
write!(stream, "{}", mail);
} else {
write!(stream, "Sorry, no new messages!");
}
@skade
skade / function_to_copy.rs
Last active October 28, 2015 19:06
function_to_copy
use std::net::{TcpListener, TcpStream};
use std::io::BufReader;
use std::io::BufRead;
use std::io::Write;
fn read_message(stream: &mut TcpStream) -> String {
let mut read_buffer = String::new();
let mut buffered_stream = BufReader::new(stream);
let res = buffered_stream.read_line(&mut read_buffer);
@skade
skade / search_ug_berlin.md
Last active August 29, 2015 14:27
Search Usergroup Berlin

Hello members of the (-Elastic)Search UserGroup Berlin,

Many of you have been asking about the future of the Elasticsearch UG Berlin. A few months ago we announced the temporary shutdown of the meetup while we negotiated how to continue the meetup due to some disagreements. We continued discussing this over the last few months and finally agreed to relaunch the meetup with a bit changed scope. We very much enjoyed running the group in the old form and it has been one of the most active groups in that space, with 32 events over the time it lasted. Only Elasticsearch France is more active.

Today we are announcing the re-launch of the group under a different name: Search Berlin and with a broadened scope: search. We will open the group to other topics from the same space. We believe this will lead to a more informative environment for all attendees and provides independence to the community effort. Elasticsearch and the products around it will of course stay an important topic. This comes along with a few mino

@skade
skade / rust-party.md
Last active August 29, 2015 14:21
Rust party invitation

Hello everyone,

you may or may not remember me for speaking about Rust at several usergroups and events. I'm now co-organising the Rust usersgroup and we have a celebration: Rust 1.0 will be released on May 15th.

Rust is a modern systems programming language, statically typed and built with parallelism in mind. It is a good secondary language to more high-level languages.

We'll have two introductory talks to the language and the event. The event attempts to be as beginner-friendly as possible (you are hearing about a new language, after all!).

http://www.meetup.com/Rust-Berlin/events/222087122/ (drop by if you don't have a meetup account)

@skade
skade / experiment.mp
Created March 5, 2015 08:11
A piece of metapost
input metaobj;
%input metauml;
input TEX;
prologues:=3;
outputformat := "eps";
outputtemplate := "%j-%c.eps";
TEXPRE("%&latex" & char(10) & "\documentclass{article}\usepackage{pbox}\usepackage{makebox}\begin{document}");
TEXPOST("\end{document}");
show_empty_boxes:=true;
@skade
skade / links.md
Created November 26, 2014 11:32
Link list elasticsearch UG 2014/11