Skip to content

Instantly share code, notes, and snippets.

View stevenroose's full-sized avatar
👀
looking for a decentralized GitHub alternative

Steven Roose stevenroose

👀
looking for a decentralized GitHub alternative
View GitHub Profile
@stevenroose
stevenroose / playground.rs
Created January 21, 2020 17:07 — forked from rust-play/playground.rs
Code shared from the Rust Playground
pub fn fmt_value_in(&self, f: &mut fmt::Write, denom: Denomination) -> fmt::Result {
let sats = match self.as_sat().checked_abs() {
Some(sats) => sats,
None => {
assert_eq!(self.as_sats(), i64::min_value());
2147483648 // u64::max_value() - self.as_sat() as u64 + 1
}
};
fmt_satoshi_in(sats, self.is_negative(), f, denom)
}
@stevenroose
stevenroose / pr.md
Created December 7, 2016 16:12 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: