View rust-term.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
use std::io::{ stdin, BufferedReader }; | |
use std::comm::Chan; | |
fn input_line(chan: Chan<(~str)>) { | |
let mut reader = BufferedReader::new(stdin()); | |
for line in reader.lines() { | |
chan.try_send(line); | |
} | |
} |
View id.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
// The C method signature is as follows: | |
int | |
getgrouplist(const char *name, int basegid, int *groups, int *ngroups); | |
// My Rust extern block | |
extern { | |
fn getgrouplist(name: *libc::c_char, | |
basegid: libc::c_int, |
View gist:9237968
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
extern crate collections; | |
use std::str; | |
use collections::HashMap; | |
use std::io::File; | |
use std::io::BufferedReader; | |
use std::cmp; | |
fn sorted_key(string: &str) -> ~[u8] { | |
// if we need to handle decomposed vs composed then we should use |
View gist:9286311
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 struct RenderWindow; | |
pub struct Engine<'a> { | |
priv caption: &'static str, | |
priv window: RenderWindow, | |
priv key_actions: 'a|| | |
} | |
pub struct EngineLoop<'a> { | |
priv game_loop: 'a|&mut Engine|, |
View gist:9788707
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
> xcodebuild install | |
=== BUILD TARGET fish_shell OF PROJECT fish WITH THE DEFAULT CONFIGURATION (Release) === | |
Check dependencies | |
Write auxiliary files | |
/bin/mkdir -p /Users/kevin/Dev/fish-shell/build/fish.build/Release/fish_shell.build | |
write-file /Users/kevin/Dev/fish-shell/build/fish.build/Release/fish_shell.build/fish.hmap | |
write-file /Users/kevin/Dev/fish-shell/build/fish.build/Release/fish_shell.build/fish-own-target-headers.hmap | |
/bin/mkdir -p /Users/kevin/Dev/fish-shell/build/fish.build/Release/fish_shell.build/Objects-normal/x86_64 |
View filter.sieve
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
require ["envelope", "imapflags", "fileinto", "reject", "notify", "vacation", "regex", "relational", "comparator-i;ascii-numeric", "body", "copy"]; | |
# Spam processing | |
if not header :contains ["X-Spam-known-sender"] "yes" { | |
if allof ( | |
header :contains ["X-Backscatter"] "yes", | |
not header :matches ["X-LinkName"] "*" | |
) { | |
discard; | |
stop; |
View foo.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
use std::cell::RefCell; | |
trait Foo {} | |
impl Foo for () {} | |
fn main() { | |
let foo: RefCell<~Foo> = RefCell::new(~() as ~Foo); | |
let fooref: &mut Foo = *&mut *foo.borrow_mut(); | |
println!("{:?}", fooref); |
View gist:9969457
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::cell::{Ref,RefCell}; | |
#[deriving(Show)] | |
struct Creature { | |
x: int | |
} | |
struct Foo { | |
creatures: Vec<RefCell<Creature>> | |
} |
View gist:10293280
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::iter; | |
static MAP_SIZE: uint = 10; | |
static TILE_SIZE: f32 = 10.; | |
pub struct Map { | |
tiles: [[u8,..MAP_SIZE],..MAP_SIZE], | |
view: Vec<(f32,f32,u8)>, | |
view_y: uint, | |
view_x: uint, |
View v2.0.0-rc1
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
object 35936f8fc38a214cc7d2595070641d39a541dfb1 | |
type commit | |
tag v2.0.0-rc1 | |
tagger Junio C Hamano <gitster@pobox.com> 1398445732 -0700 | |
Git 2.0-rc1 | |
-----BEGIN PGP SIGNATURE----- | |
Version: GnuPG v1.4.11 (GNU/Linux) | |
iQIcBAABAgAGBQJTWpakAAoJELC16IaWr+bL6iAQAKkSnkem0S+FkcBsZ+K62SXQ |
OlderNewer