Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Trinadh Koya trinadhkoya

💭
I may be slow to respond.
View GitHub Profile
View param-io.tech-assignemnt.js
var temp = [1, 2, 4, 5, 6, 8, 2, 7, 2];
var encountered = [];
function f(a) {
let min = -1;
for (let i = 0; i < a.length; i++) {
let id = i + 1;
while (id !== 0) {
id = a.indexOf(a[i], id) + 1;
View index.html
<!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">
View index.html
<!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">
View base64ToPDF.js
const doDownloadPDF = () => async dispatch => {
let filename_attachment = '1';
let ext = '.pdf';
let base64Str = res.base64();
let pdfLocation = DocumentDir + '/' + filename_attachment + ext;
await RNFetchBlob.fs.writeFile(pdfLocation, base64Str, 'base64').then((res) => {
// eslint-disable-next-line no-console
console.log(res)
}, (err) => {
View build.gradle
defaultConfig {
applicationId "com.vicinia.tinmen"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.getVersionCode()
versionCode vcode
versionName "4.0"
multiDexEnabled true
}
View build.gradle
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 19
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
googlePlayServicesVersion = "16.0.0"
getVersionCode = { ->
try {
View incrementBuild.sh
#Update build number with number of git commits if in release mode
if [ ${CONFIGURATION} == "Release" ]; then
buildNumber=$(git rev-list HEAD | wc -l | tr -d ' ')
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"
fi;
View gist:455c2489a923e3f8d8f3ed1a13180f86
const convertOrdersToDeliveryTags = async (orders, address) => {
const deliveryTags = _.map(orders, (order) => {
return {
userName: order.get('user').get('name'),
productName: order.get('product').get('name'),
orderNumber: order.get('orderNumber'),
isPicked: !_.isEmpty(order.get('pickedAt')),
isDelivered: !_.isEmpty(order.get('deliveredAt')),
isReturned: !_.isEmpty(order.get('returnedAt')),
@trinadhkoya
trinadhkoya / disableFontScaling.js
Created Jun 27, 2019
The below snippet disables the font scaling through out your react native app.
View disableFontScaling.js
if (Text.defaultProps == null) {
Text.defaultProps = {};
Text.defaultProps.allowFontScaling = false;
}
View CardViewWithShadows.js
cardViewAndroid: {
elevation: 3,
width: width - 80,
height: width * 0.5,
shadowColor: colors.black,
shadowOpacity: 0.3,
shadowRadius: 3,
shadowColor: 'rgba(0,0,0,0.2)',
shadowOffset: {width: 1, height: 1},