Skip to content

Instantly share code, notes, and snippets.

Avatar

hiroshi mimori mogeta

View GitHub Profile
@mogeta
mogeta / sample.sh
Created Jun 9, 2018
Lambda周りのコマンド類
View sample.sh
# バイナリ作成
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 Jun 9, 2018
lambdaからfirebase
View myFirestore.go
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 Jun 7, 2018
AWS IoT エンタープライズボタンを押したら、slackに投稿する。ver 1
View main.go
package main
import (
"fmt"
"github.com/aws/aws-lambda-go/lambda"
"github.com/nlopes/slack"
)
func Post(event IotButtonEvent) (string, error) {
View log
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
View rx.ipynb
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 Dec 7, 2017
https://github.com/ReactiveX/RxPY の解説。Subjectについて。
View subject.py
from rx.subjects import Subject
def is_even(num):
"""
偶数かどうかを判定する。filterで呼び出されている。
TrueかFalseを返すのであって、数値自体は返さない。
:param num:
:return: Bool
"""
@mogeta
mogeta / index.html
Created Dec 5, 2017
gasでpolymerするときのtemplate
View index.html
<!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 Aug 5, 2017
mergespecfileの設定例
View mergespecfile.txt
#
# 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
View UploadStorage.java
//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 Sep 15, 2016
firebase dto
View FoodMenu.java
public class FoodMenu {
private String title;
private String detail;
private int price;
private String photoURL;
public FoodMenu(){
}