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
import React from "react"; | |
import { | |
SafeAreaProvider, | |
Metrics, | |
initialWindowMetrics as defaultInitialWindowMetrics, | |
} from "react-native-safe-area-context"; | |
import { theme as defaultTheme, ITheme } from "native-base/src/theme"; | |
import type { IColorModeProviderProps } from "native-base/src/core/color-mode"; | |
import HybridProvider from "native-base/src/core/hybrid-overlay/HybridProvider"; | |
import { OverlayProvider } from "@react-native-aria/overlays"; |
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
/** | |
* 1. Create a state management / centralized store | |
* 2. Create a generic service which will be used by all the reducers / slices of the state management | |
* 3. On service call failures, add the payload and action to the reprocess queue | |
* 4. Create an EvenStream which would listen to the failure events receiving from the base service | |
* 5. Send the event as telemetry to the server - either retry sending to the same endpoint / send to common log collector service | |
* 6. After notifying remove the even from the stream | |
*/ | |
const apiEvent = { |
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
db.getCollection('routes').aggregate([ | |
{ | |
$match: {city: 'Pune', transport: 'subway'} | |
}, | |
{ | |
$project: {emit: {key: {city: '$city', transport: '$transport'}, features: '$featureCollection.features'}} | |
}, | |
{ | |
$group: { | |
_id: "$emit.key", |
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
const tsv = ` | |
@PageTotal:120 @PageNow:1 @Num:599 @NumReturn:5 | |
ID Name Image Countries Domains CommissionRate Category | |
39 Mothercare http://my-rewards.com/img/adv_logo/id-12639481.png "in" "mothercare.in" 4.41%~10.00% "Children","Costumes","Green & Eco","Menswear","Womenswear","Fashion","Activewear","Lingerie","Men","Women","Other","Shopping" | |
168 Droom http://my-rewards.com/img/adv_logo/in-867168490.jpeg "in" "droom.in" other "Travel","Travel" | |
169 IGP.com http://my-rewards.com/img/adv_logo/igp.png "global" "indiangiftsportal.com" 4.55% "Travel","Transportation" | |
211 Acer http://my-rewards.com/img/adv_logo/us-220211666.png "in" "store.acer.com" 2.45%~3.00% "Accessories","Computers","Computers","Hardware","Electronics" | |
865 Domino's Pizza http://my-rewards.com/img/adv_logo/us-535865648.jpeg "in" "pizzaonline.dominos.co.in","m.dominos.co.in" INR20.00 "Food & Drink","Restaurant","Gourmet","Food & Drink" | |
`; |
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
# install watchman on WSL Ubuntu distro | |
sudo apt-get install -y autoconf automake build-essential python2-dev pkg-config libtool | |
cd ~ | |
git clone https://github.com/facebook/watchman.git -b v4.9.0 --depth 1 | |
cd watchman | |
./autogen.sh | |
./configure --enable-lenient | |
make |
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
REM List the running distros | |
wsl --list -v | |
REM Shutdown all distros | |
wsl --shutdown | |
REM create a directory on a different drive (not necessary) to move the data | |
mkdir e:\system\docker\wsl-{distro}\ | |
REM export the distro data to tar |
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
interface Tree { | |
[index: string]: number | Tree; | |
} | |
const getUniqueSortedNumbers = (tree: Tree, items: number[] = []): number[] => { | |
Object.keys(tree).map((key: string) => | |
typeof tree[key] === 'object' | |
? getUniqueSortedNumbers(tree[key] as Tree, items) | |
: items.indexOf(tree[key] as number) <= 0 && items.push(tree[key] as number) |
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
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"defaultProfile": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}", | |
"copyOnSelect": false, | |
"copyFormatting": false, | |
"alwaysShowTabs": true, | |
"profiles": { | |
"defaults": { | |
"colorScheme": "UbuntuLegit", | |
"backgroundImage": "C:\\Users\\<default-user>\\Pictures\\<picture-file>.jpg", |
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
cd /home/<user>/ | |
sudo apt-get install unzip | |
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip | |
unzip sdk-tools-linux-4333796.zip -d Android | |
rm sdk-tools-linux-4333796.zip | |
sudo apt-get install -y lib32z1 openjdk-8-jdk | |
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 | |
export PATH=$PATH:$JAVA_HOME/bin | |
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc | |
cd Android/tools/bin |
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
## get list of vscode packages, which you can use to install later | |
code --list-extensions | % { "code --install-extension $_" } | |
## get list of choco packages, which you can use to install later | |
choco list --local-only | % { $_.split(' ')[0] } | % { "choco install -y $_" } |
NewerOlder