Skip to content

Instantly share code, notes, and snippets.

View lilyball's full-sized avatar

Lily Ballard lilyball

View GitHub Profile
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);
}
}
@lilyball
lilyball / id.rs
Last active August 29, 2015 13:56 — forked from alan-andrade/id.rs
// 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,
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
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|,
> 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
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;
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);
use std::cell::{Ref,RefCell};
#[deriving(Show)]
struct Creature {
x: int
}
struct Foo {
creatures: Vec<RefCell<Creature>>
}
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,
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