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
#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(); |
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
#![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 |
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
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 |
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(collections)] | |
extern crate eventual; | |
use eventual::*; | |
#[derive(Debug)] | |
struct Foo; | |
struct A { | |
on_foo_handlers: Vec<Sender<Foo, &'static str>> |
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(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> |
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(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>> |
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(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>> |
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 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(); |
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 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(); |
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
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()); | |
} |