Skip to content

Instantly share code, notes, and snippets.

View nattatorn-dev's full-sized avatar

Mark nattatorn-dev

  • LedgerX Co., Ltd.
  • Bangkok, Thailand
View GitHub Profile
@nattatorn-dev
nattatorn-dev / cloudSettings
Last active August 16, 2020 13:25
sync vscode workspace setting for everywhere
{"lastUpload":"2020-08-16T13:25:04.868Z","extensionVersion":"v3.4.3"}
version: '3.1'
services:
wordpress:
depends_on:
- db
image: wordpress:latest
container_name: wordpress_avada
restart: always
volumes:
using System;
using System.Collections.Generic;
using System.Text;
using static System.Console;
namespace DesignPatterns
{
public enum OutputFormat
{
Markdown,
static propTypes = {
data: PropTypes.array.isRequired,
title: PropTypes.string.isRequired,
len: PropTypes.number,
keyName: PropTypes.string.isRequired,
showLess: PropTypes.bool.isRequired,
containerStlye: PropTypes.object,
children: PropTypes.node,
}
static defaultProps = {
import { is } from "immutable";
function CompareFn(objA, objB) {
if (objA === objB || is(objA, objB)) {
return true;
}
if (
typeof objA !== "object" ||
objA === null ||
typeof objB !== "object" ||
const indexByKey = key => pipe(
indexBy(prop(key)),
map(omit([key])) // eslint-disable-line
);
const indexByKey = key => pipe(
indexBy(prop(key)),
map(omit([key])) // eslint-disable-line
);
// ...
lifecycle({
componentWillMount() {
const { subscribeToMessages } = this.props;
return subscribeToMessages();
},
})
)(ChatMessages);
@nattatorn-dev
nattatorn-dev / es7-async-await.js
Created June 13, 2017 18:06 — forked from msmfsd/es7-async-await.js
Javascript fetch JSON with ES7 Async Await
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch
// async function
async function fetchAsync () {
// await response of fetch call
let response = await fetch('https://api.github.com');
// only proceed once promise is resolved
let data = await response.json();
// only proceed once second promise is resolved
var arr = [0,1,2,3,4];
var g = arr.join(', ').replace(/,(?!.*,)/gmi, ' and');
// result 0, 1, 2, 3 and 4