Skip to content

Instantly share code, notes, and snippets.

View pnkfelix's full-sized avatar
🍩
re-pat; ex-🥐

Felix S Klock II pnkfelix

🍩
re-pat; ex-🥐
View GitHub Profile
lunch-box. perf record -g -F99 rustc --crate-name clap src/lib.rs --crate-type lib --emit=dep-info,metadata -C codegen-units=4 -C debuginfo=2 --cfg 'feature="ansi_term"' --cfg 'feature="atty"' --cfg 'feature="color"' --cfg 'feature="default"' --cfg 'feature="strsim"' --cfg 'feature="suggestions"' --cfg 'feature="vec_map"' -C metadata=d202d71b943170bd -C extra-filename=-d202d71b943170bd --out-dir /home/nmatsakis/versioned/rustc-perf/collector/benchmarks/clap-rs/target/debug/deps -L dependency=/home/nmatsakis/versioned/rustc-perf/collector/benchmarks/clap-rs/target/debug/deps --extern bitflags=/home/nmatsakis/versioned/rustc-perf/collector/benchmarks/clap-rs/target/debug/deps/libbitflags-a639890d93be049d.rmeta --extern strsim=/home/nmatsakis/versioned/rustc-perf/collector/benchmarks/clap-rs/target/debug/deps/libstrsim-61acaf2d398b2611.rmeta --extern unicode_width=/home/nmatsakis/versioned/rustc-perf/collector/benchmarks/clap-rs/target/debug/deps/libunicode_width-92d73134b87da7cc.rmeta --extern atty=/home/nmatsa
@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active November 15, 2024 17:51
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

@pnkfelix
pnkfelix / chickpea-masala.md
Last active June 27, 2017 15:16
Pressure Cooker Chicken and Chickpea Masala
@chris-morgan
chris-morgan / result_for.rs
Created February 20, 2014 02:19
A prototype of a `Result<T, E>`-based `Iterator<T, E>` replacing the `Option<T>`-based `Iterator<T>`.
#[feature(macro_rules)];
// There must be two variants of the macro for this simple prototype, each of
// them lacking one important feature and with one remaining feature completely
// infeasible in a macro_rules! macro. Done properly in the compiler these
// would be entirely reasonable.
// A variant with support for an output value from the else clause, but with no
// support for breaking out of the `for` block.
macro_rules! forr1 (
#[macro_escape];
use std::rt::task::Task;
use std::rt::local::Local;
mod libunwind;
macro_rules! run(
($expr:expr) => (
{
@klutzy
klutzy / hello.rs
Last active April 26, 2016 19:15
Rust with Emscripten
// emscripten uses le32-unknown-nacl triple but rustc doesn't know it now.
// So just use similar target instead.
// `rustc hello.rs --target=i686-unknown-linux --emit-llvm -S --cfg libc`
// `emcc hello.ll -o hello.js`
// no `extern mod`.
#[no_std];
#[feature(macro_rules)];
use core::container::Container;
@amatus
amatus / rust_for_rpi.md
Last active February 18, 2017 21:13 — forked from anonymous/gist:6664882
Howto build a rust compiler for the Raspberry Pi on Debian 7.1 (wheezy)

Howto build a rust compiler for the Raspberry Pi on Debian 7.1 (wheezy)

sudo apt-get install git build-essential
test `uname -m` = x86_64 && sudo apt-get install ia32-libs
git clone https://github.com/raspberrypi/tools.git
export PATH=$PWD/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:$PATH
git clone http://github.com/mozilla/rust.git
cd rust
./configure --target-triples=arm-unknown-linux-gnueabihf

make

@Aatch
Aatch / trait_visitor.rs
Created June 26, 2013 07:41
Visitor impl using a trait & default methods.
#[allow(default_methods)];
extern mod syntax;
use std::os;
use syntax::abi::AbiSet;
use syntax::codemap::span;
use syntax::parse;
use syntax::opt_vec;
@Aatch
Aatch / borrow-example.rs
Last active July 5, 2023 04:22 — forked from kolmodin/rust-json.rs
An example and explanation of how to use lifetimes and borrowing to avoid copying, while maintaining safety.
extern mod extra;
use extra::json::*;
/*
* This function manages to do absolutely no copying, which is pretty cool.
*
* "What are all those `'r`s?" you ask. Well, they're liftime parameters. They
* indicate how long something lasts (before it's freed). They can't change how
* long something lives for, they only allow you to tell the compiler stuff it
  • perform system update
    • if you do it later it will ask for all kind of permissions to override various config files
    • change password for root
      • default password is user
  • Fix trackpad
  • logout and log back in