Skip to content

Instantly share code, notes, and snippets.

Yohei Okaya akehoyayoi

Block or report user

Report or block akehoyayoi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View movie-ticket-modeling.scala
// 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 Sep 5, 2018
[Rust]所有権、所有権、所有けんけんけけんけん ref: https://qiita.com/akehoyayoi/items/abe58c8d7be198587a34
View main.c
#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;
View Enhancer.scala
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 Jul 7, 2018
Hyperledger Fabricのブロックの内容を見る ref: https://qiita.com/akehoyayoi/items/d0654880382850f7cd2b
View config.json
{
"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
Cordovaでハイブリッドのテンプレ作るまでまとめ(Cordova+OnsenUI+vue.js) ref: https://qiita.com/akehoyayoi/items/a370071cb3747a943dd7
View file0.txt
$ 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
View .ebextensions.ssh.config
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 Jun 24, 2017
Excel外部起動
View execMacro.vbs
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 Jun 24, 2017
TravisでAndroidNDKを使っているプロジェクトをビルドする ref: http://qiita.com/akehoyayoi@github/items/570694f926fd6b7db2a4
View  .travis.yml
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
View FibTest.scala
import scala.collection.mutable
/**
* Created by okayayohei on 2017/03/11.
*/
object Main {
trait Fib {
def fib(n: Long): Long
}
View file0.txt
mysql> desc shop;
+---------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+--------------+------+-----+---------+-------+
| name | varchar(100) | NO | | NULL | |
| address | varchar(100) | NO | | NULL | |
| lnglat | geometry | NO | MUL | NULL | |
+---------+--------------+------+-----+---------+-------+
3 rows in set (0.04 sec)
You can’t perform that action at this time.