Skip to content

Instantly share code, notes, and snippets.

View ledmonster's full-sized avatar
🤖

Junya Hayashi ledmonster

🤖
View GitHub Profile
import datetime
import json
import pathlib
import subprocess
from logging import getLogger
from web3 import Web3
from web3.auto.infura import w3
@ledmonster
ledmonster / metrics.go
Created August 25, 2020 04:45
push prometheus exposition format metrics to VictoriaMetrics remote_write endpoint
package metrics
import (
"bytes"
"context"
"fmt"
"net/http"
"os"
"time"
@ledmonster
ledmonster / sample.py
Created November 16, 2019 07:42
openpose sample
import sys
sys.path.append('/usr/local/python')
import cv2
from openpose import pyopenpose as op
def main():
@ledmonster
ledmonster / test_aioredis.py
Created August 26, 2019 09:03
Run aioredis with trio_asyncio
import asyncio
from contextlib import asynccontextmanager, AsyncExitStack
import aioredis
import trio_asyncio
async def test_aioredis():
""" test to use aioredis in trio using trio_asyncio """
async with trio_asyncio.open_loop():
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ledmonster
ledmonster / file0.txt
Last active August 29, 2015 14:13
ValueObject implementation in Python ref: http://qiita.com/ledmonster/items/2f16d52cdf58d1a73685
class ValueObject(object):
""" base class for Value Objects
please call _set_properties in constructor.
"""
def __new__(class_, *args, **kwargs):
self = object.__new__(class_, *args, **kwargs)
self.__initialized = False
self.__params = dict()
@ledmonster
ledmonster / catan_nagare.js
Last active August 29, 2015 14:05
カタンで流れがあることを検証するスクリプト
'use strict';
var _ = require('underscore');
var Bacon = require('baconjs').Bacon;
var RANGE = 36;
var PRODUCTIVITY = {
2: 1/36,
3: 2/36,