json api server using grace
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" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"regexp" | |
"strings" | |
) |
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" | |
"fmt" | |
"os" | |
"path/filepath" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/service/s3" |
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
# coding: utf-8 | |
from __future__ import absolute_import, print_function, unicode_literals | |
import logging | |
import pstats | |
class StatsLogger(object): | |
def __init__(self, stats): |
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
# coding: utf-8 | |
from __future__ import absolute_import, print_function, unicode_literals | |
import session | |
class AutoScaling(object): | |
def __init__(self, name): | |
self._client = session.get(name).client('autoscaling') |
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
# coding: utf-8 | |
from datetime import datetime | |
import threading | |
__all__ = ['get', 'clear'] | |
class Cache(dict): |
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
#!/bin/sh | |
cd ${WORKSPACE} | |
BRANCH=`echo ${GIT_BRANCH} | cut -d'/' -f2` | |
git checkout ${BRANCH} | |
git pull origin ${BRANCH} | |
git submodule sync > /dev/null && git submodule -i > /dev/null | |
for FILE in `git diff --name-only ${GIT_PREVIOUS_COMMIT} ${GIT_COMMIT} | grep "py$"`; do |
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" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os" | |
) |
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
# coding: utf-8 | |
from __future__ import absolute_import, print_function, unicode_literals | |
import sys | |
class PrimMSTGraph(object): | |
def __init__(self, size): | |
self._size = size |
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
# coding: utf-8 | |
from __future__ import absolute_import, print_function, unicode_literals | |
class Edge(object): | |
def __init__(self, point1, point2, cost): | |
self.point1 = point1 | |
self.point2 = point2 | |
self.cost = cost |