Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import getopt
import random
import sys
import urllib2
def usage():
print 'Usage of req.py:'
print '\tpython req.py [OPTIONS] [REQUEST(S)]'
#!/bin/sh
# Download OS X binaries of rust and install to $HOME/opt.
BASENAME=/usr/bin/basename
CUT=/usr/bin/cut
URL=https://static.rust-lang.org/dist/rust-nightly-x86_64-apple-darwin.tar.gz
FILE=$($BASENAME $URL)
DIR=$($CUT -d '.' -f 1 $FILE)
@gsquire
gsquire / main.rs
Created April 29, 2015 18:21
Rust Compiler Panic
extern crate hyper;
#[macro_use]
extern crate nickel;
extern crate rustc_serialize;
use std::io::Read;
use hyper::Client;
use nickel::{Nickel, HttpRouter, QueryString};
use rustc_serialize::json;
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
#!/usr/bin/env python
#
# author: Garrett Squire, gsquire
#
# 08/05/2015
#
import argparse
import os
import sys
#!/usr/bin/env python
import json
import pprint
import signal
import sys
import requests
from twisted.internet import reactor
#!/bin/bash
for d in $HOME/.vim/bundle/*; do
echo "updating $(basename $d)..."
(cd $d && git pull)
done
printf "\nall plugins updated\n"
// Package test.
//
// The purpose is to demonstrate swagger docs for a test app.
//
// Schemes: http
// Host: localhost
// Produces:
// - application/text
//
// swagger:meta
// 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.
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 {