View generic_assertions.rs
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
/// Warning: Pseudo-Rust Code | |
/// Some rough ideas how `assert_cli` could accept arbitrary assertions and possibly | |
/// support interactive commands. | |
/// | |
/// The current simple API could be implemented on top of this more general one. | |
Cmd::run("") | |
.with_timeout(Duration(...)) | |
.assert(StdOut::ends_with("Are you sure?")) // ::starts_with, ::eq, ::ne, ::contains |
View no_std_expanded.rs
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(prelude_import)] | |
#![no_std] | |
#![no_std] | |
#![feature(collections)] | |
#![allow(dead_code)] | |
#[prelude_import] | |
use core::prelude::v1::*; | |
#[macro_use] | |
extern crate core as core; |
View rust_macros_1.1.html
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>macros 1.1</title> | |
<meta charset="utf-8"> | |
<style> | |
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic); |
View atom-rust-packages
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
# Run this in your shell to install a set of atom-plugins | |
# for working with rust projects and git | |
# Rust essentials | |
apm install language-rust racer linter linter-rust build build-cargo cargo-test-runner rust-api-docs-helper | |
# Other | |
apm install keyboard-localization autoupdate-packages project-manager atom-terminal minimap docblockr theme-switcher | |
# Git |
View bar.rs
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
#![crate_type = "lib"] | |
#![crate_name = "bar"] | |
extern crate foo; | |
use foo::Channel; | |
pub fn a<VALUE: Into<i32>>(mut builder: Channel, value: VALUE) -> Channel { | |
builder.a(value.into()).clone() | |
} | |
pub fn b<VALUE: Into<i32>>(mut builder: Channel, value: VALUE) -> Channel { |
View test_dependencies.sh
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
#!/bin/bash | |
# This script will loop over arrays of dev-dependencies | |
# | |
# - loops can be nested (not nice but efficient) | |
# - http://doc.crates.io/specifying-dependencies.html | |
CUSTOM_DERIVE_VERSIONS=( | |
"=0.1.0" | |
"0.1" |
View main.rs
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
mod builder { | |
#[derive(Default, Clone)] | |
pub struct Channel { | |
a: i32, | |
b: i32, | |
c: i32, | |
} | |
impl Channel { | |
pub fn a<VALUE: Into<i32>>(&mut self, value: VALUE) -> &mut Self { |
View main.rs
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
#[derive(Debug, Default)] | |
struct Channel { | |
special_info: i32 | |
} | |
impl Channel { | |
fn special_info<VALUE: Into<i32>>(mut self, value: VALUE) -> Self { | |
self.special_info = value.into(); | |
self | |
} |
View lib.rs
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
macro_rules! match_and_then { | |
{ $val:tt .. {$( $default_action:tt )*}; $( {$( $pattern:tt )+} => {$( $action:tt )*} ;)*} => { | |
macro_rules! __callback_match_and_then { | |
$( {$( $pattern )+} => {$( $action )*}; )* | |
{ $any:tt } => {$( $default_action )*}; | |
} | |
__callback_match_and_then!($val); | |
} | |
} |
View teamcity-agent.sh
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: TeamCity_BuildAgent | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start build agent daemon at boot time | |
# Description: Enable service provided by daemon. | |
### END INIT INFO |
NewerOlder