This file contains hidden or 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
const start_time = performance.now(); | |
const count: number = 1000; | |
const wallets: Wallet[] = []; | |
const walletCount = await WalletModel.find({}).estimatedDocumentCount(); | |
// create a cursor for every `currentIndex` documents in the collection | |
const getNthCursor = async (currentIndex: number) => | |
await WalletModel.find({ deleted_at: undefined }, { timeout: false }) | |
.lean() |
This file contains hidden or 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
import redis, { RedisClient } from "redis"; | |
import { promisify } from "util"; | |
export class Redis implements IRedis { | |
redis: RedisClient; | |
hdel: (hash: string, field: string) => Promise<any>; | |
hget: (hash: string, field: string) => Promise<string>; | |
hgetall: (key: string) => Promise<object>; | |
hset: (hash: string, field: string, value: any) => Promise<any>; | |
quit: () => Promise<void>; |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<ImageView | |
android:id="@+id/image" |
This file contains hidden or 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
// Utility function to get version properties | |
def getVersionProps() { | |
def versionPropsFile = file('gradle.properties') | |
if (!versionPropsFile.exists()) { | |
versionPropsFile.createNewFile() | |
} | |
def versionProps = new Properties() | |
versionProps.load(new FileInputStream(versionPropsFile)) | |
return versionProps | |
} |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<View | |
android:layout_width="0dp" |
This file contains hidden or 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
<android.support.v7.widget.CardView | |
android:id="@+id/backdrop" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="16dp" | |
android:background="@color/transparent" | |
app:cardCornerRadius="8dp" | |
app:cardElevation="8dp" | |
app:layout_constraintEnd_toStartOf="@+id/guidelineRight" | |
app:layout_constraintHorizontal_bias="0.0" |
This file contains hidden or 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
const mongoose = require('mongoose') | |
const { PersonSchema } = require('./person') | |
class ManSchema extends PersonSchema { | |
constructor(obj, options) { | |
super(obj, options) | |
this.add({ age: { type: String, required: true } }) | |
} | |
} |
This file contains hidden or 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
exports.paramsNotValid = (...args) => args | |
.map(param => param !== undefined && param != null && param !== '') | |
.includes(false) |
This file contains hidden or 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
package com.fxmallam.app.utils.widgets | |
import android.content.Context | |
import android.content.res.ColorStateList | |
import android.graphics.Rect | |
import android.support.design.widget.TextInputLayout | |
import android.support.v4.view.ViewCompat | |
import android.support.v4.view.ViewPropertyAnimatorListenerAdapter | |
import android.support.v4.view.animation.FastOutSlowInInterpolator | |
import android.text.TextUtils |
This file contains hidden or 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
<!-- KitKat Fix Activity --> | |
<activity | |
android:name=".player.KitKatFixActivity" | |
android:allowTaskReparenting="true" | |
android:alwaysRetainTaskState="true" | |
android:clearTaskOnLaunch="true" | |
android:enabled="true" | |
android:excludeFromRecents="true" | |
android:finishOnTaskLaunch="true" | |
android:noHistory="true" |