Skip to content

Instantly share code, notes, and snippets.

Avatar

hiroshi mimori mogeta

View GitHub Profile
View angular_interceptor.js
import {Injectable} from '@angular/core';
import {
HttpRequest,
HttpHandler,
HttpEvent,
HttpInterceptor
} from '@angular/common/http';
import {Observable} from 'rxjs';
import {tap} from "rxjs/operators";
import {AuthService} from "./auth.service";
View JWK.go
func getJWKKey(token *jwt.Token) (interface{}, error) {
kid := fmt.Sprintf("%v", token.Header["kid"])
set, err := jwk.FetchHTTP(jwkKeyURL)
if err != nil {
log.Printf("failed to parse JWK: %s", err)
return nil, err
}
@mogeta
mogeta / back.py
Created Feb 15, 2019
AppiumとAirtestを利用したハイブリッドゲームアップのE2Eテスト
View back.py
# -*- encoding=utf8 -*-
from airtest.core.api import *
auto_setup(__file__)
# 指定画像を捜査しタッチ捜査をおこなう。
# back.airディレクトリ内に画像配置済み
def back_button():
touch(Template(r"tpl1550048906014.png", record_pos=(-0.472, -0.255), resolution=(1920, 1080)))
@mogeta
mogeta / functions_exmaple.dart
Created Jan 22, 2019
Firebase環境でWebPush
View functions_exmaple.dart
//こっちはFunctions側
import 'package:http/http.dart' as http;
import 'package:sprintf/sprintf.dart';
const String ENDPOINT = 'https://iid.googleapis.com/iid/v1/%s/rel/topics/%s';
Future<int> Subscribe(String serverKey, String token, String topic) async {
int status;
var url = sprintf(ENDPOINT, [token, topic]);
print(url);
View app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
View flutter doctor.log
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v0.8.2, on Microsoft Windows [Version 10.0.17134.285], locale ja-JP)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[√] Android Studio (version 3.2)
[√] VS Code (version 1.27.2)
[!] Connected devices
! No devices available
! Doctor found issues in 1 category.
View gist:b1e4b1b3a9c46bbd677098a97684f5da
choco install dart-lang
choco install androidstudio
flutter doctor
flutter doctor --android-licenses
View gist:e6a6cb6298889bded777454908a5590f
Not ignored files:
└─ dist/bundle.js
Ignored files:
└─ dist/appsscript.json
View food_from_photo_api.go
package main
import (
"context"
"golang.org/x/oauth2"
"fmt"
"log"
"golang.org/x/oauth2/google"
"io/ioutil"
"google.golang.org/api/photoslibrary/v1"
View request.json
{
"filters": {
"dateFilter": {
"dates": [
{
"day": 11,
"month": 6,
"year": 2018
}
]