Skip to content

Instantly share code, notes, and snippets.

macro_rules! join {
($($s:expr),+) => ({
let mut agg = String::new();
$(agg.push_str($s);)*
agg
});
}
macro_rules! repeat {
($s:expr, $n:expr) => ({
#!/usr/bin/env python3
"""
A simple tool to generate rust documentation and copy it to a location to be served from.
Requires Python 3.5.
"""
import os
import os.path
use std::env;
use std::io;
use std::io::prelude::*;
use std::fs::File;
fn cat(f: &String) -> io::Result<String> {
let mut f = try!(File::open(f));
let mut contents = String::new();
try!(f.read_to_string(&mut contents));
use std::fmt::Debug;
fn merge<T>(left: &mut Vec<T>, right: &mut Vec<T>) -> Vec<T> where T: Ord + Clone + Debug {
let mut result: Vec<T> = Vec::new();
while !left.is_empty() && !right.is_empty() {
if left[0] <= right[0] {
result.push(left[0].clone());
left.remove(0);
} else {
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Package test.
//
// The purpose is to demonstrate swagger docs for a test app.
//
// Schemes: http
// Host: localhost
// Produces:
// - application/text
//
// swagger:meta
#!/bin/bash
for d in $HOME/.vim/bundle/*; do
echo "updating $(basename $d)..."
(cd $d && git pull)
done
printf "\nall plugins updated\n"
#!/usr/bin/env python
import json
import pprint
import signal
import sys
import requests
from twisted.internet import reactor
#!/usr/bin/env python
#
# author: Garrett Squire, gsquire
#
# 08/05/2015
#
import argparse
import os
import sys
thread 'rustc' panicked at 'capacity overflow', /home/rustbuild/src/rust-buildbot/slave/beta-dist-rustc-linux/build/src/libcore/option.rs:330
stack backtrace:
1: 0xb72fb2e2 - sys::backtrace::write::hcdc84c0b4ff2d0210Us
2: 0xb73040af - panicking::on_panic::h648c349e933f04fefix
3: 0xb72bcb91 - rt::unwind::begin_unwind_inner::h4b09f5e533d8f6dbpXw
4: 0xb72bce66 - rt::unwind::begin_unwind_fmt::hfcd734ca6a9a0e3b3Vw
5: 0xb7303c76 - rust_begin_unwind
6: 0xb735e699 - panicking::panic_fmt::h5b37663d5154430bQEC
7: 0xb5a62375 - codemap::CodeMap::span_to_lines::h425051b2a91f12da2eA