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
@skade
skade / queue.rs
Last active August 29, 2015 14:05
A simple queue with network access in Rust. Send any non-empty string to localhost:1234 to insert it, send "" to retrieve it.
use std::collections::dlist::DList;
use std::collections::Deque;
use std::io::net::tcp::{TcpListener,TcpStream};
use std::io::{BufferedStream,Acceptor,Listener,Reader,Stream};
enum Command {
Push(String),
Pop
}
@skade
skade / umlaut_problem.rb
Created November 26, 2014 11:01
A quick way to break the input handling of mongodb using Umlauts
# encoding: UTF-8
require 'mongo'
include Mongo
mongo_client = MongoClient.new
db = mongo_client.db("test")
coll = db.collection("txt")
coll.ensure_index(
@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 / 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 / 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 / Compiler warnings
Created November 8, 2009 04:10
Compiler warnings and failing tests for rbtree
gcc -I. -I/usr/local/include/ruby-1.9.1/x86_64-darwin10.0.0 -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -DNDEBUG -DHAVE_RB_ENUMERATORIZE -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -pipe -o dict.o -c dict.c
gcc -I. -I/usr/local/include/ruby-1.9.1/x86_64-darwin10.0.0 -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -DNDEBUG -DHAVE_RB_ENUMERATORIZE -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -pipe -o rbtree.o -c rbtree.c
rbtree.c: In function ‘value_eq’:
rbtree.c:430: warning: implicit conversion shortens 64-bit value into a 32-bit value
rbtree.c: In function ‘to_hash_i’:
rbtree.c:1062: warning: passing argument 1 of ‘rb_hash_tbl’ makes integer from poi
diff --git a/padrino-core/lib/padrino-core/application/routing.rb b/padrino-core/lib/padrino-core/application/routing.rb
index a978218..3ea7c25 100644
--- a/padrino-core/lib/padrino-core/application/routing.rb
+++ b/padrino-core/lib/padrino-core/application/routing.rb
@@ -12,6 +12,8 @@ module Padrino
# to the url throughout the application.
#
module Routing
+ CONTENT_TYPE_ALIASES = {:htm => :html}
+
@skade
skade / questions.rb
Created May 28, 2011 13:45
This short Padrino application hopefully answers all your questions
require 'padrino-core'
class Questions < Padrino::Application
get '/*' do
redirect "http://padrinorb.com"
end
end
Questions.run!
@skade
skade / adium.log
Created August 22, 2011 09:57
Debug log from Adium Adium_1.5hgr4170
11:55:41: (Libpurple: util) Writing file blist.xml to directory /Users/skade/Library/Application Support/Adium 2.0/Users/Default/libpurple
11:55:41: (Libpurple: util) Writing file /Users/skade/Library/Application Support/Adium 2.0/Users/Default/libpurple/blist.xml
11:55:42: (Libpurple: oscar) Requesting ICQ alias for 57636396
11:55:42: (Libpurple: oscar) icq response: 54 bytes, 69792705, 0x07da, 0x00c3
11:55:46: (Libpurple: jabber) Recv (ssl)(342): <message from='botzenhart@googlemail.com/Offics449C4424' to='skade@jabber.ccc.de/Florian-Gilchers-MacBook-Pro' type='chat' id='purplea0970399'><cha:composing xmlns:cha='http://jabber.org/protocol/chatstates'/><nos:x value='disabled' xmlns:nos='google:nosave'/><arc:record otr='false' xmlns:arc='http://jabber.org/protocol/archive'/></message>
11:55:46: (Libpurple: oscar) Requesting ICQ alias for 12111
11:55:47: (Libpurple: oscar) icq response: 54 bytes, 69792705, 0x07da, 0x00c4
11:55:47: (Libpurple: jabber) Recv (ssl)(579): <message from='botzenhart@googlemail.com/Of
@skade
skade / query.json
Created September 16, 2011 20:26
Prettier gist
{
"query": {
"filtered": {
"query": {
"text": {
"_all": "poker"
}
},
"filter": [
{