Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"log"
"math"
"net/http"
"os"
"os/exec"
"time"
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