Skip to content

Instantly share code, notes, and snippets.

View akehoyayoi's full-sized avatar

Yohei Okaya akehoyayoi

View GitHub Profile
@akehoyayoi
akehoyayoi / image-padder.py
Last active June 17, 2022 05:50
簡易画像データ水増しツール
import glob
import cv2
import numpy as np
import os
import tqdm
from PIL import Image, ImageChops
def effect_gamma(image):
gamma = 1.5
gamma_cvt = np.zeros((256,1),dtype = 'uint8')
@akehoyayoi
akehoyayoi / index.ts
Created June 2, 2021 06:34
PubSub typescript sample
// "dependencies": {
// "@google-cloud/pubsub": "^2.3.0",
// "firebase-admin": "^9.8.0",
// "firebase-functions": "^3.14.1"
// },
import * as functions from "firebase-functions";
import { PubSub } from '@google-cloud/pubsub';
// under construction ...
sealed trait BusinessDaySpec
case object WorkDay extends BusinessDaySpec
case object Holiday extends BusinessDaySpec
sealed trait MovieDaySpec
case object MovieDay extends MovieDaySpec
@akehoyayoi
akehoyayoi / main.c
Last active September 5, 2018 08:42
[Rust]所有権、所有権、所有けんけんけけんけん ref: https://qiita.com/akehoyayoi/items/abe58c8d7be198587a34
#include <stdio.h>
#include <string>
#include <iostream>
#include <vector>
int main(){
auto s = new std::vector<std::string>();s->push_back("udon");s->push_back("ramen");s->push_back("soba");
auto t = s; s = NULL;
auto u = s; s = NULL;
std::cout << (*s)[0] << std::endl;
@akehoyayoi
akehoyayoi / Enhancer.scala
Created August 15, 2018 22:50
mixin example
class TreeControl[T] {
// これらのIFを使いたい
dataNodes: T[];
def getLevel(node: T): Int = {}
}
class NestedTreeControl[T] extends TreeControl[T] {}
class FlatTreeControl[T] extends TreeControl[T] {}
trait TreeControlEnhancer[T] {
@akehoyayoi
akehoyayoi / config.json
Created July 7, 2018 02:06
Hyperledger Fabricのブロックの内容を見る ref: https://qiita.com/akehoyayoi/items/d0654880382850f7cd2b
{
"network-config": {
"org1": {
"name": "peerOrg1",
"mspid": "Org1MSP",
"peer1": {
"requests": "grpc://127.0.0.1:7051",
"events": "grpc://127.0.0.1:7053",
"server-hostname": "peer0.org1.example.com",
"tls_cacerts": "<fabric-samples-PATH>/basic-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
@akehoyayoi
akehoyayoi / file0.txt
Last active May 13, 2018 07:54
Cordovaでハイブリッドのテンプレ作るまでまとめ(Cordova+OnsenUI+vue.js) ref: https://qiita.com/akehoyayoi/items/a370071cb3747a943dd7
$ npm install -g vue-cli
$ vue init OnsenUI/vue-cordova-webpack my-project
$ cd my-project
$ npm install
$ cordova plugin add cordova-plugin-facebook4 --save --variable APP_ID="1234567890" --variable APP_NAME="your_app_name"
$ cordova platform add ios
$ cordova platform add android
$ npm run build
$ cordova prepare
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/01_prepare_authorized_keys":
mode: "000777"
content: |
ARRAY=(
https://github.com/akehoyayoi.keys # アクセスできるようにしたいアカウントを列挙しておく
)
echo 'ssh-rsa 元々あったauthorized_keyを書いておく' > authorized_keys
for item in ${ARRAY[@]}; do
@akehoyayoi
akehoyayoi / execMacro.vbs
Created June 24, 2017 04:06
Excel外部起動
Do While True
Dim excelApp : Set excelApp = CreateObject("Excel.Application")
' Excelを非表示にする
excelApp.Visible = False
Dim targetFile : targetFile = "[ファイル名]"
Dim targetMacro : targetMacro = "[マクロ名]"
' Excelファイルを開く
excelApp.Workbooks.Open targetFile
' マクロの実行
@akehoyayoi
akehoyayoi /  .travis.yml
Last active June 24, 2017 01:33
TravisでAndroidNDKを使っているプロジェクトをビルドする ref: http://qiita.com/akehoyayoi@github/items/570694f926fd6b7db2a4
language: objective-c
sudo: true
cache:
directories:
- $HOME/Library/Caches/Homebrew
before_install:
- brew update
- brew tap caskroom/cask
- brew install caskroom/cask/android-sdk caskroom/cask/android-ndk
- export ANDROID_HOME=/usr/local/share/android-sdk