This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Injectable() | |
export class AwsService { | |
public async isMainInstance(): Promise<boolean> { | |
/* | |
* インスタンスメタデータを取得するための手続き。IMDSv2で実装。 | |
* https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html | |
*/ | |
const token = await firstValueFrom( | |
this.http | |
.put( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { MenuController } from '@ionic/angular'; | |
import { NgZone } from '@angular/core'; | |
@Component({ | |
selector: 'app-tab1', | |
templateUrl: 'tab1.page.html', | |
styleUrls: ['tab1.page.scss'] | |
}) | |
export class Tab1Page { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { Plugins, MotionEventResult, MotionOrientationEventResult } from '@capacitor/core'; | |
@Component({ | |
selector: 'app-home', | |
templateUrl: 'home.page.html', | |
styleUrls: ['home.page.scss'], | |
}) | |
export class HomePage { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alter table tweet drop index geom; | |
alter table tweet modify geom geometry not null SRID 4326 ; | |
alter table tweet add spatial index(geom); | |
UPDATE tweet | |
SET | |
geom = CASE | |
WHEN | |
area_type = 1 | |
THEN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package jp.rdlabo.capacitor.plugin.screenshotevent; | |
import com.getcapacitor.JSObject; | |
import com.getcapacitor.NativePlugin; | |
import com.getcapacitor.Plugin; | |
import com.getcapacitor.PluginCall; | |
import com.getcapacitor.PluginMethod; | |
import com.getcapacitor.util.HostMask; | |
import android.os.FileObserver; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import Capacitor | |
import AVFoundation | |
/** | |
* Please read the Capacitor iOS Plugin Development Guide | |
* here: https://capacitor.ionicframework.com/docs/plugins/ios | |
*/ | |
@objc(MlkitPlugin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let isAlert = false; | |
setTimeout(() => { | |
if (!isAlert) { | |
// Alertをだしてユーザが選択したらreload | |
} | |
}, 2000); <= Timeout時間 | |
this.afAuth.auth.currentUser.getIdToken(false) | |
.then() | |
.finally(() => isAlert = true); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Injectable({ | |
providedIn: 'root', | |
}) | |
export class AuthService { | |
constructor( | |
public http: HttpClient, | |
public storage: Storage, | |
) {} | |
async getState() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ yarn add @ionic/angular@4.7.1 @ionic/angular-toolkit@2.0.0 -D | |
$ yarn add @angular-devkit/architect@0.801.2 @angular-devkit/build-angular@0.801.2 @angular-devkit/core@8.1.3 @angular-devkit/schematics@8.1.3 @angular/cli@8.1.3 @angular/compiler@8.1.3 @angular/compiler-cli@8.1.3 | |
(場合によってはここでnode_moduleを削除しないといけないかも) | |
$ npx ng update @angular/core@8.1.3 @angular/cli@8.1.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Directive, ElementRef, Input, OnDestroy, OnInit } from '@angular/core'; | |
import { Keyboard } from '@ionic-native/keyboard'; | |
import { Content, Platform } from 'ionic-angular'; | |
import { Observable } from 'rxjs/Observable'; | |
import { Subscription } from 'rxjs/Subscription'; | |
/** | |
* @name KeyboardAttachDirective | |
* @source https://gist.github.com/rdlabo/942671d8c9cffb02676756cdd56aa1c0 | |
* @forked https://gist.github.com/Manduro/bc121fd39f21558df2a952b39e907754 |
NewerOlder