Skip to content

Instantly share code, notes, and snippets.

View hirokazumiyaji's full-sized avatar

Hirokazu Miyaji hirokazumiyaji

View GitHub Profile
@hirokazumiyaji
hirokazumiyaji / main.go
Created August 27, 2015 03:47
Google Play Application Version Checker
package main
import (
"flag"
"fmt"
"io/ioutil"
"net/http"
"regexp"
"strings"
)
@hirokazumiyaji
hirokazumiyaji / README.md
Created August 26, 2015 02:02
Facebook grace Example

Facebook grace Example

main.go

json api server using grace

request

@hirokazumiyaji
hirokazumiyaji / predeploy.go
Last active September 21, 2017 20:38
consul deploy using AWS Lambda Function
package main;
import (
"flag"
"fmt"
"os"
"path/filepath"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/s3"
@hirokazumiyaji
hirokazumiyaji / profile.py
Last active August 29, 2015 14:28
Python cProfile/pstats output json format
# coding: utf-8
from __future__ import absolute_import, print_function, unicode_literals
import logging
import pstats
class StatsLogger(object):
def __init__(self, stats):
@hirokazumiyaji
hirokazumiyaji / autoscale.py
Last active August 29, 2015 14:27
boto3 auto scaling
# 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')
# coding: utf-8
from datetime import datetime
import threading
__all__ = ['get', 'clear']
class Cache(dict):
@hirokazumiyaji
hirokazumiyaji / formatter.sh
Created August 3, 2015 06:19
isort and autopep8 code format script when jenkins build
#!/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
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
)
@hirokazumiyaji
hirokazumiyaji / prim.py
Created July 20, 2015 13:37
Prim's MST Algorithm
# coding: utf-8
from __future__ import absolute_import, print_function, unicode_literals
import sys
class PrimMSTGraph(object):
def __init__(self, size):
self._size = size
@hirokazumiyaji
hirokazumiyaji / edge.py
Last active August 29, 2015 14:25
Kruskal's algorithm
# 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