Skip to content

Instantly share code, notes, and snippets.

View hirokazumiyaji's full-sized avatar

Hirokazu Miyaji hirokazumiyaji

View GitHub Profile
@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 / 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 / patch.py
Created August 27, 2015 13:07
ujson -> json patch when pypy
import sys
def patch_json():
try:
import __pypy__
except ImportError:
pass
else:
import json
sys.modules['ujson'] = json
@hirokazumiyaji
hirokazumiyaji / appuser.py
Created May 7, 2014 10:18
Djangoでgeventを使用する場合と使用しない場合の比較してみる。
# coding: utf-8
from __future__ import absolute_import, unicode_literals
import gevent
from django.db import models
from django.utils.functional import cached_property
class AppUser(models.Model):
id = models.CharField(max_length=100, primary_key=True)
name = models.CharField(max_length=100)
class Smaple(models.Model):
var_id = models.IntegerField()
@cached_property
def var(self):
return Var.get(self.var_id)
var count = 0
for scene in scenes {
if scene.hasPrefix("Act 1") {
count += 1
}
}
count = scenes.filter({$0.hasPrefix("Act 1")}).count
@hirokazumiyaji
hirokazumiyaji / Gemfile
Created August 10, 2014 03:27
gemfile for creating cookbook
source 'https://rubygems.org'
gem 'chef'
gem 'knife-solo'
@hirokazumiyaji
hirokazumiyaji / email.py
Created September 1, 2014 12:48
Amazon SES using django
# coding: utf-8
from boto import ses
from django.conf import settings
class EMail(object):
def __init__(self):
self._connection = ses.connect_to_region(
@hirokazumiyaji
hirokazumiyaji / config.go
Last active August 29, 2015 14:06
go configuration
package go
import (
"io/ioutil"
"github.com/gonuts/yaml"
)
var Config = make(map[string]interface{})
func Load(yamlFile string) (err error) {
@hirokazumiyaji
hirokazumiyaji / index.html
Created September 23, 2014 14:06
angularjs sample
<!doctype html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.min.js"></script>
<script type="text/javascript">
function tableController($http, $scope) {
$scope.records = [
{
id: 1,
name: 'John',