Skip to content

Instantly share code, notes, and snippets.

View taingmeng's full-sized avatar

Meng Taing taingmeng

  • Zendesk
  • Singapore
View GitHub Profile
@taingmeng
taingmeng / PULL_REQUEST_TEMPLATE.md
Created November 16, 2019 23:15
Create Github default pull request description template for your project

Description

Context

Checklist:

  • Updated tests for this change.
  • Tested the changes locally.
@taingmeng
taingmeng / App.js
Created November 25, 2017 13:55
Badminton Score Tutorial - Part 2 - Final
import React, { Component } from 'react';
import './App.css';
import annyang from './Annyang'
class App extends Component {
constructor() {
super();
this.state = {
players: [
{
@taingmeng
taingmeng / Annyang.js
Last active November 19, 2017 02:40
Badminton Score Tutorial - Part 2
import annyang from 'annyang'
class Annyang {
// 1
isSupported() {
return annyang !== null
}
// 2
start() {
@taingmeng
taingmeng / App.css
Last active November 25, 2017 13:41
Badminton Score Tutorial
body {
margin: 0;
padding: 0;
font-family: sans-serif;
}
.score-container {
display: flex;
align-items: center;
text-align: center;
@taingmeng
taingmeng / App.js
Last active November 13, 2017 14:14
Badminton Score Tutorial
import React, { Component } from 'react';
import './App.css';
class App extends Component {
constructor() {
super();
this.state = {
players: [
{
name: 'Player 1',
@taingmeng
taingmeng / Pluralize.kt
Last active October 15, 2017 03:29
Pluralize String with Kotlin Extension
fun String.pluralize(count: Int): String? {
return this.pluralize(count, null)
}
fun String.pluralize(count: Int, plural: String?): String? {
return if (count > 1) {
plural ?: this + 's'
} else {
this
}