Skip to content

Instantly share code, notes, and snippets.

View takahirohonda's full-sized avatar

Takahiro Honda takahirohonda

View GitHub Profile
@takahirohonda
takahirohonda / my-twa-config-res-values-string.xml
Last active September 15, 2019 01:18
my-twa-config-res-values-string.xml
<resources>
<string name="app_name">Sitecore Quiz</string>
<string name="asset_statements">
[{
\"relation\": [\"delegate_permission/common.handle_all_urls\"],
\"target\": {
\"namespace\": \"web\",
\"site\": \"https://mydatahack.github.io\"}
}]
</string>
@takahirohonda
takahirohonda / my-twa-config-AndroidManifest.xml
Last active September 15, 2019 01:15
my-twa-config-AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.mdhsitecorequiz.twa.sitecorecertificationexamquiz">
<application
android:allowBackup="true"
android:icon="@mipmap/sitecore_quiz_icon"
android:label="Sitecore Quiz"
android:roundIcon="@mipmap/sitecore_quiz_icon"
android:supportsRtl="true"
@takahirohonda
takahirohonda / my-twa-config-module-build.gradle
Created September 14, 2019 02:25
my-twa-config-module-build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
@takahirohonda
takahirohonda / my-twa-config-project-build.gradle
Last active September 15, 2019 01:14
my-twa-config-project-build.gradle
buildscript {
ext.kotlin_version = '1.3.31'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
@takahirohonda
takahirohonda / why-address-bar-is-not-hidden-android-app-with-twa.json
Created September 13, 2019 23:54
why-address-bar-is-not-hidden-android-app-with-twa.json
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.mdhsitecorequiz.sitecorecertificationexamquiz",
"sha256_cert_fingerprints":
["SHA-256 certificate fingerpring in App sining cert from Google Play"]
}
}]
@takahirohonda
takahirohonda / sitecore-9-certified-platform-associate-developer-exam-prep-quiz.html
Last active September 7, 2019 00:57
sitecore-9-certified-platform-associate-developer-exam-prep-quiz.html
<div id="sc-quiz-root"></div>
<style>
.sc-quiz-question {
color: #212529;
opacity: 1;
font-size: 16px;
}
.sc-quiz-choices-title{
color: #212529;
opacity: 1;
@takahirohonda
takahirohonda / node-module-to-retrieve-multiple-parameters-from-aws-parameter-store-4.js
Created August 19, 2019 12:42
node-module-to-retrieve-multiple-parameters-from-aws-parameter-store-4.js
'use strict';
const AWS = require('aws-sdk');
const { getParameter } = require('../play/get-parameter');
let ssm;
const getParameters = (parameterNames, region, getParameterFunc=getParameter) => {
if (!ssm) {
ssm = new AWS.SSM({apiVersion: '2014-11-06', region: region});
}
@takahirohonda
takahirohonda / node-module-to-retrieve-multiple-parameters-from-aws-parameter-store-3.js
Created August 19, 2019 12:40
node-module-to-retrieve-multiple-parameters-from-aws-parameter-store-3.js
'use strict';
const getParameter = (parameterName, ssm) => {
const value = ssm.getParameter({'Name': parameterName, WithDecryption: true}).promise();
return value.then( (data) =>{
return data.Parameter.Value;
})
.catch((err) => {
@takahirohonda
takahirohonda / node-module-to-retrieve-multiple-parameters-from-aws-parameter-store-2.js
Created August 19, 2019 12:36
node-module-to-retrieve-multiple-parameters-from-aws-parameter-store-2.js
'use strict';
const { getParameters } = require('@mdhnpm/aws-ssm-parameters');
// Input is an array of parameter names
const parameterNames = [
'my.db.endpoint',
'my.db.name',
'my.db.password',
'my.db.username'
@takahirohonda
takahirohonda / node-module-to-retrieve-multiple-parameters-from-aws-parameter-store-1.js
Created August 19, 2019 12:35
node-module-to-retrieve-multiple-parameters-from-aws-parameter-store-1.js
'use strict';
const AWS = require('aws-sdk');
let ssm;
const getParameters = async (parameterNames, region, apiVersion='2014-11-06') => {
if (!ssm) {
ssm = new AWS.SSM({apiVersion: apiVersion, region: region});
}