Skip to content

Instantly share code, notes, and snippets.

View pzol's full-sized avatar

Piotr Zolnierek pzol

View GitHub Profile
@pzol
pzol / gist:de21fd4da32a7795a3cc
Last active August 29, 2015 14:26 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan Developer Preview 2

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@pzol
pzol / rate_append_test.rb
Last active August 29, 2015 14:18
cmd.rb
require 'test_helper'
require 'masterize'
require 'master_hotels/cmd/rate_append'
class RateAppendTest < Minitest::Test
include MasterHotels
def test_append
ra = Cmd::RateAppend.new
cmd = ra.append("WRO0001", {})
use std::str;
struct UpperChars<'a> {
chars: str::Chars<'a>
}
struct LowerChars<'a> {
chars: str::Chars<'a>
}
use std::cell::RefCell;
use std::mem;
struct Foo {
bar: String
}
thread_local!(static LOOKUP: RefCell<Option<Vec<Foo>>> = RefCell::new(None));
fn lookup<'a>(idx: usize) -> Option<&'static str> {
use std::io::{self, IoResult, MemReader};
use rustc_serialize::{ Encodable };
use rustc_serialize::json::{ self, Json };
use response::IntoReader;
pub trait IntoReader {
type OutReader: Reader;
fn into_reader(self) -> Self::OutReader;
}
use std::io::{self, IoResult, MemReader};
use hyper::status;
use hyper::net::Fresh;
pub use hyper::server::Response as HttpResponse;
use hyper::header::Headers;
pub struct Response {
pub body: Option<Box<Reader + Send>>
}
extern crate core;
use core::cell::Cell;
#[deriving(Copy, Show)]
struct Pos(u32, u32);
#[deriving(Show)]
struct Monster {
name: String,
pos: Cell<Pos>
@pzol
pzol / box.rs
Last active August 29, 2015 14:12
#[deriving(Show)]
struct Monster {
name: String,
hp: uint
}
struct Game {
monsters: Vec<Box<Monster>>
}
@pzol
pzol / split.rs
Last active August 29, 2015 14:11
struct StrSplits<'a> {
buf: &'a str,
finished: bool,
sep: char
}
impl<'a> StrSplits<'a> {
pub fn new(buf: &'a str) -> StrSplits<'a> {
StrSplits { buf: buf, finished: false, sep: '|' }
}
use std::str;
struct UpperChars<'a> {
chars: str::Chars<'a>
}
struct LowerChars<'a> {
chars: str::Chars<'a>
}