Skip to content

Instantly share code, notes, and snippets.

@lkuper
lkuper / stuff.rs
Last active December 17, 2015 22:38 — forked from steveklabnik/stuff.rs
extern mod std;
use std::base64::ToBase64;
use core::str::Clone;
fn hex_to_base64(source: &str) -> ~str {
let bytes = str::to_bytes(source);
let mut nums: ~[u8] = ~[];
for uint::range_step(0, bytes.len(), 2) |i| {
let num = u8::parse_bytes(bytes.slice(i, i+2), 16);
rust-try:
#!/bin/bash
git diff --quiet HEAD
if [[ "$?" != "0" ]]; then
echo "Cannot push to try with uncommitted changes."
exit 1
fi
git push -f mozilla HEAD:try