Skip to content

Instantly share code, notes, and snippets.

View mogeta's full-sized avatar

hiroshi mimori mogeta

View GitHub Profile
@mogeta
mogeta / sample.sh
Created June 9, 2018 08:31
Lambda周りのコマンド類
# バイナリ作成
env GOARCH=amd64 GOOS=linux go build myfirestore.go struct.go
# テスト環境で実行
sam local invoke -e event.json -t template.yaml --env-vars sam_env.json
# Lambdaに上げるファイルの作成。secret_keyをアップロードするのを忘れずに
zip myfirestore.zip myfirestore firebase_secret_key.json
@mogeta
mogeta / myFirestore.go
Created June 9, 2018 08:13
lambdaからfirebase
package main
import (
"context"
"firebase.google.com/go"
"google.golang.org/api/option"
"log"
"time"
"github.com/aws/aws-lambda-go/lambda"
)
@mogeta
mogeta / main.go
Last active June 7, 2018 00:21
AWS IoT エンタープライズボタンを押したら、slackに投稿する。ver 1
package main
import (
"fmt"
"github.com/aws/aws-lambda-go/lambda"
"github.com/nlopes/slack"
)
func Post(event IotButtonEvent) (string, error) {
@mogeta
mogeta / log
Created December 27, 2017 07:23
ng new project-name
firebase init
? What do you want to use as your public directory? dist
? Configure as a single-page app (rewrite all urls to /index.html)? Yes
? File dist/index.html already exists. Overwrite? No
i Skipping write of dist/index.html
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mogeta
mogeta / subject.py
Last active December 7, 2017 01:45
https://github.com/ReactiveX/RxPY の解説。Subjectについて。
from rx.subjects import Subject
def is_even(num):
"""
偶数かどうかを判定する。filterで呼び出されている。
TrueかFalseを返すのであって、数値自体は返さない。
:param num:
:return: Bool
"""
@mogeta
mogeta / index.html
Created December 5, 2017 05:11
gasでpolymerするときのtemplate
<!DOCTYPE html>
<html lang="en">
<head>
<base href="https://cdn.rawgit.com/download/polymer-cdn/2.0.1/lib/">
<script src="webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="app-layout/app-layout.html">
<link rel="import" href="iron-icon/iron-icon.html">
<link rel="import" href="iron-icons/iron-icons.html">
<link rel="import" href="paper-button/paper-button.html">
<link rel="import" href="paper-checkbox/paper-checkbox.html">
@mogeta
mogeta / mergespecfile.txt
Created August 5, 2017 01:59
mergespecfileの設定例
#
# UnityYAMLMerge fallback file
#
# Modify the next two lines if scene or prefab files should fallback
# on other that the default fallbacks listed below.
#
# %l is replaced with the path of you local version
# %r is replaced with the path of the incoming remote version
# %b is replaced with the common base version
# %d is replaced with a path where the result should be written to
//upload image for firebase storage
private void updateImage(ImageView imageView){
// Create a storage reference from our app
FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference storageRef = storage.getReferenceFromUrl("<your-storage-url>");
String uuid = UUID.randomUUID().toString();
StorageReference mountainsRef = storageRef.child(uuid + ".jpg");
imageView.setDrawingCacheEnabled(true);
imageView.buildDrawingCache();
@mogeta
mogeta / FoodMenu.java
Last active September 15, 2016 15:30
firebase dto
public class FoodMenu {
private String title;
private String detail;
private int price;
private String photoURL;
public FoodMenu(){
}