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
// see | |
// https://github.com/aws-amplify/amplify-js/issues/14315 | |
// AWS認証テストスクリプト | |
import { Amplify } from 'aws-amplify'; | |
import { fetchAuthSession } from 'aws-amplify/auth'; | |
// 認証テスト関数 | |
async function testAuthentication() { |
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
// AWS SDK v3 を使って、Identity Pool から認可情報を取得するサンプル | |
import { | |
CognitoIdentityClient, | |
GetIdCommand, | |
GetCredentialsForIdentityCommand, | |
} from '@aws-sdk/client-cognito-identity'; | |
console.log('AWS認証テストを開始します...'); | |
async function testAuthentication() { |
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
#!/usr/bin/env ruby | |
# 必要な gem 名 | |
gem_name = 'aws-sdk-cognitoidentity' | |
# gem が未インストールならインストール | |
begin | |
gem gem_name | |
rescue LoadError | |
puts "🔧 '#{gem_name}' が見つかりません。インストールします..." |
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
require 'openssl' | |
require 'cgi' | |
require 'base64' | |
# see https://developer.twitter.com/ja/docs/authentication/oauth-1-0a/creating-a-signature | |
module Oauth1_0a | |
class Authorization | |
attr_accessor :http_method, :url, :consumer_key, :consumer_secret, :token, :token_secret, :nonce, :timestamp | |
def initialize(http_method:, url:, consumer_key:, consumer_secret:, token:, token_secret:) |
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
require 'fileutils' | |
class DuplicateFileCleaner | |
class << self | |
def run(dir: '', extname: 'txt', dryrun: false) | |
self.new(extname, dryrun).cleanup(dir) | |
end | |
end | |
def initialize(extname, dryrun) |
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
FROM node:10.16.3-alpine | |
WORKDIR /app | |
RUN apk update && \ | |
npm install -g npm @vue/cli |
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
AWSTemplateFormatVersion: 2010-09-09 | |
Description: --- | |
create IAM user only access S3 bucket | |
# validate | |
- aws cloudformation validate-template --template-body file://template.yml | |
# crete stack | |
- aws cloudformation create-stack --stack-name S3IAMUser --template-body file://template.yml --capabilities CAPABILITY_NAMED_IAM |
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
require 'test/unit' | |
# Array#override | |
# | |
# [0, 0, 0, 0, 0].override(['a', 'b']) | |
# => ['a', 'b', 0, 0, 0] | |
# | |
# [0, 0, 0, 0, 0].override(['a', 'b'], 2) | |
# => [0, 0, 'a', 'b', 0] |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: "App Name", | |
params: [], | |
// paramsより後に定義すると、値が正しく判定されない | |
isFiltered: Ember.computed.or('params', 'appName'), | |
}); |
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
const AWS = require('aws-sdk'); | |
const dynamoDb = new AWS.DynamoDB.DocumentClient({ | |
region: "ap-northeast-1" | |
}); | |
// exports.handler = (event, context, callback) => { | |
// const data = { | |
// name: "yuto", | |
// email: "[email protected]", |
NewerOlder