This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymongo | |
# TODO have this file take the contents of the .yml file and put it into the project_ref file. | |
db = pymongo.Connection()["mci_dev"] | |
collection = db["project_ref"] | |
local_config_file = open("config_dev/project/sample.yml") | |
local_config = "\n".join(local_config_file.readlines()) | |
db.project_ref.update({"identifier" : "sample"}, {"identifier" : "sample", "owner_name": "mpobrien", "branch_name": "master", | |
"repokind": "github", "enabled": True, "repo_name": "sample", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> hello world</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//getMax | |
//getPctDiff | |
//getSampleComparison | |
//getCommits | |
// | |
// | |
console.log("loading from rawgit! 3") | |
/* | |
{ | |
"name": "perf", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
# | |
# Copyright 2007 Google Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import boto | |
import pymongo | |
db = pymongo.Connection()['mci'] | |
ec2 = boto.connect_ec2() | |
chain = itertools.chain.from_iterable | |
all_instances = list(chain([res.instances for res in ec2.get_all_instances()])) | |
all_instance_ids = set(instance.id for instance in all_instances) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"gopkg.in/mgo.v2" | |
) | |
func main() { | |
// connect to mongod | |
sess, err := mgo.Dial("localhost:33333") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "net/http" | |
import "fmt" | |
import "github.com/gorilla/mux" | |
func HomeHandler(w http.ResponseWriter, r *http.Request) { | |
w.Write([]byte("home!")) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"code.google.com/p/go.crypto/ssh" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"time" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "flag" | |
import "labix.org/v2/mgo" | |
import "labix.org/v2/mgo/bson" | |
import "fmt" | |
import "time" | |
import "encoding/json" | |
type ProfileOp struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dump a cursor to BSON, from inside shell | |
// db.users.find({"username":"ian"}).dump("/tmp/users.bson") | |
// cursor options work: skip(), limit(), readpref, etc. | |
// Restore a collection from BSON, inside shell | |
// db.users.restore("/tmp/users.bson") | |
// You can dump aggregation data too | |
// db.users.aggregate({$group:{_id:"location", count:{$sum:1}}}).dump('/tmp/users_by_loc.bson') |