Skip to content

Instantly share code, notes, and snippets.

View tilpner's full-sized avatar

Till Höppner tilpner

  • Germany
  • 04:37 (UTC +02:00)
View GitHub Profile
@tilpner
tilpner / app.c
Last active August 29, 2015 14:18
#include <stdio.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
int main(int argc, char **argv)
{
int status;
lua_State *L = luaL_newstate();
#![no_std]
#![feature(no_std, libc, lang_items, start)]
#![no_main]
//! ```sh
//! # compile
//! rustc -C opt-level=3 -C no-stack-check standalone.rs
//! # strip
//! strip -sR .comment -R .gnu.hash -R .gnu.version -R .note.ABI-tag -R .note.gnu.build-id standalone
//! # check size
set nocompatible " break Vi compat
filetype off
" If fish is the default shell, use sh, as fish is not POSIX compatible
if &shell =~# 'fish$'
set shell=sh
endif
""""""""""""""""""""""""""""""""
" Bundles
#![feature(collections)]
extern crate eventual;
use eventual::*;
#[derive(Debug)]
struct Foo;
struct A {
on_foo_handlers: Vec<Sender<Foo, &'static str>>
#![feature(slicing_syntax)]
use std::borrow::ToOwned;
#[derive(Clone)]
pub struct Message {
pub prefix: Option<String>,
pub command: String,
pub content: Vec<String>,
pub suffix: Option<String>
#![feature(collections)]
extern crate eventual;
use eventual::*;
#[derive(Debug)]
struct Foo;
struct A<'a> {
on_foo_handlers: Vec<Sender<(&'a mut A<'a>, &'a Foo), &'static str>>
#![feature(collections)]
extern crate eventual;
use eventual::*;
#[derive(Debug)]
struct Foo;
struct A<'a> {
on_foo_handlers: Vec<Sender<(&'a mut A<'a>, &'a Foo), &'static str>>
use std::io;
use std::io::prelude::*;
extern crate parser_combinators;
use parser_combinators::{spaces, many1, sep_by, digit, satisfy, Parser, ParserExt, ParseError};
fn main() {
let mut stdin = io::stdin();
let mut stdout = io::stdout();
use std::io;
use std::io::prelude::*;
extern crate parser_combinators;
use parser_combinators::{spaces, many1, sep_by, digit, satisfy, Parser, ParserExt, ParseError};
fn main() {
let mut stdin = io::stdin();
let mut stdout = io::stdout();
pub fn volume_create(volume: &str,
count: usize,
transport: Transport,
bricks: Vec<Brick>,
force: bool,
key: &str) ->Result<i32, String>{
if bricks.is_empty(){
return Err("The brick list is empty. Not creating volume".to_string());
}