Skip to content

Instantly share code, notes, and snippets.

View ohtangza's full-sized avatar

Jay Oh ohtangza

View GitHub Profile
{
languageChoices.map(choice => (
filterValues.languageCode === choice.id &&
<Datagrid {...props} ids={this.state[choice.id]}>
<TextField source="text" />
<ReferenceField source="contentId" reference="contents">
<TextField source="title" />
</ReferenceField>
<BooleanField source="keepable" />
<TextField source="languageCode" />
const styleObject = StyleSheet.create({
merged: {
color: 'black',
fontSize: 11,
},
black: {
color: 'black',
},
smallFont: {
@ohtangza
ohtangza / aws-polly-http1.js
Last active March 8, 2018 06:25
AWS Polly via HTTP API
import axios from 'axios';
import aws4 from 'aws4';
// https://docs.aws.amazon.com/general/latest/gr/rande.html
const endPoint = 'https://polly.ap-northeast-2.amazonaws.com';
const data = {
OutputFormat: 'mp3',
SampleRate: '16000',
Text: 'hello',
TextType: 'text',
@ohtangza
ohtangza / cancellationPromise1.js
Created February 27, 2018 02:52
Bluebird.Promise cancellation
import Promise from 'bluebird';
Promise.config({
cancellation: true,
});
console.log('Experiment A!!!');
const rootPromise1 = new Promise((resolve, reject, onCancel) => {
console.log('A: rootPromise1 started');
@ohtangza
ohtangza / js-class-syntax.js
Created January 4, 2018 08:01
JavaScript Learning Material
/*
class Abc {
instanceProperty() {
console.log('instanceProperty');
// this.classProperty();
}
classProperty = () => {
console.log('classProperty');
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@ohtangza
ohtangza / AudioRecordActivity.java
Created May 15, 2017 01:49 — forked from kmark/AudioRecordActivity.java
An example of how to read in raw PCM data from Android's AudioRecord API (microphone input, for instance) and output it to a valid WAV file. Tested on API 21/23 on Android and API 23 on Android Wear (modified activity) where AudioRecord is the only available audio recording API. MediaRecorder doesn't work. Compiles against min API 15 and probabl…
/*
* Copyright 2016 Kevin Mark
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software