Skip to content

Instantly share code, notes, and snippets.

View trinadhkoya's full-sized avatar
💭
I may be slow to respond.

trinadhkoya trinadhkoya

💭
I may be slow to respond.
View GitHub Profile
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;
<!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">
<!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">
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) => {
@trinadhkoya
trinadhkoya / build.gradle
Created September 10, 2019 08:53
app level
defaultConfig {
applicationId "com.vicinia.tinmen"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.getVersionCode()
versionCode vcode
versionName "4.0"
multiDexEnabled true
}
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 19
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
googlePlayServicesVersion = "16.0.0"
getVersionCode = { ->
try {
#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;
@trinadhkoya
trinadhkoya / gist:455c2489a923e3f8d8f3ed1a13180f86
Last active September 5, 2019 19:00
google-distance-matrix.js
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 June 27, 2019 17:18
The below snippet disables the font scaling through out your react native app.
if (Text.defaultProps == null) {
Text.defaultProps = {};
Text.defaultProps.allowFontScaling = false;
}
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},