Closures are self-contained blocks of functinality that can be PASSED around and USED in your code
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
# help to config node_modules in react native to a same build configs | |
# the code will loop through every module defie in MODULES and try to modify the build.gradle file | |
# @copyright tranquan221b@gmail.com | |
import os | |
import glob | |
import re | |
# ---------------------------------------------------------------------- | |
# FUNCTIONS: |
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
{ | |
"editor.dragAndDrop": false, | |
"editor.fontSize": 13, | |
"editor.fontFamily": "Monaco, 'Source Code Pro', Consolas, 'Ubuntu Mono', 'Courier New', monospace, 'Segoe UI Emoji'", | |
"editor.fontWeight": "100", | |
"editor.formatOnSave": true, | |
"editor.tabSize": 2, | |
"editor.wordWrap": "on", | |
"editor.wordWrapColumn": 100, | |
"editor.minimap.enabled": false, |
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
/** | |
* Auto increment versionCode for every build | |
* read version.properties in android root directory and auto increment build number on release | |
*/ | |
def readAndIncrementVersionCode() { | |
def isRelease = false | |
List<String> runTasks = gradle.startParameter.getTaskNames(); | |
for (String item : runTasks) { | |
if (item.contains("assemble") && item.contains("Release")) { |
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
/** | |
* Thanks to https://github.com/danleveille/react-native-input-accessory-demo | |
*/ | |
import React, { Component } from 'react'; | |
import { | |
Dimensions, | |
TouchableOpacity, | |
LayoutAnimation, | |
StyleSheet, | |
Keyboard, |
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
createTimeMoment() { | |
if (!this.mCreateTimeMoment) { | |
this.mCreateTimeMoment = moment(this.createTime, 'X'); | |
} | |
return this.mCreateTimeMoment; | |
} |
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
# configure app name (in strings.xml) & firebase info google-services.json | |
# to match with the environment setting in app/constants/configs.js | |
# *** developer still have to config the applicationId manually *** | |
import os | |
import glob | |
import re | |
from shutil import copyfile | |
# Contants |
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
{ | |
"eslint.enable": false, | |
"tslint.enable": false, | |
"editor.formatOnSave": true, | |
"editor.tabSize": 2, | |
"editor.wordWrap": "on", | |
"editor.wordWrapColumn": 100, | |
"editor.parameterHints": false, | |
"editor.rulers": [100], | |
"typescriptHero.imports.disableImportRemovalOnOrganize": false, |
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
/** | |
* Copyright (C) SaigonMD, Inc - All Rights Reserved | |
* Licensed under the MIT license. | |
* Written by Tran Quan <tranquan221b@gmail.com>, July 2018 | |
*/ | |
/** | |
* Log helper using Reactotron https://github.com/infinitered/reactotron | |
* - log faster than console because no need to turn-on remote debug | |
* - able to customize the message | |
*/ |
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
// source: https://www.formfakten.de/themen/2018/08/published-content-with-overridden-properties | |
public class OverriddenProperty : IPublishedProperty | |
{ | |
private readonly string alias; | |
private readonly object value; | |
public OverriddenProperty(string alias, object value) | |
{ | |
this.alias = alias; | |
this.value = value; |
OlderNewer