Skip to content

Instantly share code, notes, and snippets.

Piotr Zolnierek pzol

Block or report user

Report or block pzol

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

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

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
View rate_append_test.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", {})
View case_folds.rs
use std::str;
struct UpperChars<'a> {
chars: str::Chars<'a>
}
struct LowerChars<'a> {
chars: str::Chars<'a>
}
View global.rs
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> {
View json_response.rs
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;
}
View response.rs
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>>
}
View sauron_the_borrow_checker.rs
extern crate core;
use core::cell::Cell;
#[deriving(Copy, Show)]
struct Pos(u32, u32);
#[deriving(Show)]
struct Monster {
name: String,
pos: Cell<Pos>
View box.rs
#[deriving(Show)]
struct Monster {
name: String,
hp: uint
}
struct Game {
monsters: Vec<Box<Monster>>
}
View split.rs
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: '|' }
}
View case_folds.rs
use std::str;
struct UpperChars<'a> {
chars: str::Chars<'a>
}
struct LowerChars<'a> {
chars: str::Chars<'a>
}
You can’t perform that action at this time.