I have some need to test the bot that i created on testnet Binance. i'm using ccxt library to connect. const ccxt = require('ccxt') const binance = new ccxt.binance({ apiKey: 'APIKEY', secret: 'SECRET', options: { defaultMarket: 'future' }…
I can recommend this articles: Build your own REST API with Node, Express, Knex and PostgreSQLhttps://medium.com/javascript-in-plain-english/build-your-own-rest-api-with-node-express-knex-and-postgresql-aec98fe75e5 Build your own REST API …
my current method to retry if error occured is this: let tryCounter = 1;const retryCount = 99;let result = null;let error = [];while (tryCounter <= retryCount) { let errContainer = null; try { result = await executeAsyncMethod(); break; } …
It's been 1 years since i'm into NodeJS, and sequelize is my favorite ORM to works with database. 1.After create a new Row, you want to get the ID of the data, you must make some changes in the model, and add this. id: { allowNull: false, …
1.exa A modern version of ‘ls’. https://the.exa.website/ Github Repo: https://github.com/ogham/exa Exa have a similar options like ls , my usual way to use exa is exa -lah 2.bat A cat(1) clone with wings. Github Repo: https://github.com/sh…
Sometimes, you need to provide public key on some services, you can use this command to generate the public key $ ssh-keygen -y -f ~/pathToPrivateKey/private.pem > ~/.ssh/public.pub Enter passphrase:
There is many other ways, but this is my way to configure: Server: -Linux Ubuntu 18.04 Steps: Do upgrade repositoryapt-get update Install alien, wget and other dependency package by doing apt-get install alien wget libaio1 libaio-dev Creat…
If you have MAMP installed, and you want to use it for cli, you can add this to your bash profile export PATH=/usr/local/bin:$PATHexport PATH=/Applications/MAMP/bin/php/php5.5.10/bin:$PATH Make sure the order is correct. Put export PATH=/u…
sometimes, you want to make your image full , there is workaround. imageStyle: { height: 300, flex: 1, width: null} Using Image.getSize() class PostItem extends React.Component { state = { imgWidth: 0, imgHeight: 0, } componentDidMount() {…
i tried some of validation library, this is what i recommend, oussamahamdaoui/forgJs: ForgJs is a javascript lightweight object validator. Go check the Quick start section and start coding with lovehttps://github.com/oussamahamdaoui/forgJs…
I have nested state something like this constructor(props) { super(props); this.state = { auth: false, isStartDateTimePickerVisible: false, isEndDateTimePickerVisible: false, form: { title: 'Lorem Ipsum dolor', startDate: moment(new Date()…
i'm using sequelize for my project, and enable sync with alter table, when i run the project, sequelize always create a new indexes, usually, the code something like this. const User = this.sequelize.define('testSync', { email: { type: Seq…
React Native Android Error More than one file was found with OS independent path 'lib/x86/libusb.so'
sometimes, you will face error like this while using 3rd party plugin in react native, like android-jsc. you can set the build.gradle app level module with something like this. packagingOptions { pickFirst 'lib/armeabi-v7a/libblasV8.so' pi…
while developing react / react-native , sometimes you will face some issue if you want to post images/files upload to backend server, or if the backend need some header for submit data. you can use one of this configuration for something l…
sometimes, when you pull package from repo , or Pod, you will have error something rant about whitespace trailing whitespace after looking on some SO, i figured the easy way to fix this. git diff --cached --no-color > stage.diff && git app…
If you want to integrate Let's Encrypt to make your website running on https & using nginx. This is simple sample config for reverse proxy expressjs apps i use server { client_max_body_size 56M; server_name example.com; location / { proxy_…
If you have this issue, usually, the first time you create EC2 / VPS, then git pull from repo. you can use this command cd ~/ sudo chown -R username /Users/username
Sometimes, you need to communicate between Parent to Children Component, you can use props for this. But what if you want to communicate between Children to Parent Component, there is official method on React to do this, by using `Lifting …
Sometimes, when you try to archive ios apps, you will find Multiple commands produce errors, usually React & Yoga on React Native 0.59 you can add this to the Podfile post_install do |installer| installer.pods_project.targets.each do |targ…
if you want to cache fetch result, you can use this library. react-native-expire-storage - npmhttps://www.npmjs.com/package/react-native-expire-storage How I can set expiration date for AsyncStorage - react native - Stack Overflowhttps://s…
sometimes, you need to create textarea component, you can use this snippets. <View style={styles.textAreaContainer} > <TextInput style={styles.textArea} underlineColorAndroid="transparent" placeholder="Type something" placeholderTextColor="grey" numberOfLines={10} multiline={true} /> </View> ... con…
If you have some screen like blog post, and you have a related news, you can navigate using this const navigateAction = NavigationActions.navigate({ routeName: 'APage', params: { title: title, name: 'APage', }, key: 'APage' + APageUUID });…
There is time i'm using this library to render html in my RN apps. https://github.com/jsdf/react-native-htmlview There is some issue in rendering image on Android, because the <img> tag is wrapped in <p> so i use this regex to replace the formatti</p>…
In case you need to clean cache of the packager, Ref: https://gist.github.com/jarretmoses/c2e4786fd342b3444f3bc6beff32098d#file-react-native-clear-cache RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ &…
if you want to init RN by specific version, run this command react-native init newproject --version react-native@0.59.10 but first, install react-native-cli first
You can order it by using order by case, the example is shown below using Postgres ORDER BY CASE WHEN( status > 6) THEN 0 WHEN(status > 3) THEN 1 END
if you having some issue with emulator, and you cannot reset the Emulator using UI, you can run this command to reset the emulator emulator @avd_name -no-snapshot-load
if you face this issue, you can make the migration like this queryInterface.changeColumn('table', 'column', { type: 'INTEGER USING CAST("column" as INTEGER)' });
if you need to make some sql function, you can use something like this. const query = `CREATE OR REPLACE FUNCTION "public"."last_day"(date) RETURNS "pg_catalog"."date" AS $BODY$ SELECT (date_trunc('MONTH', $1) + INTERVAL '1 MONTH - 1 day')…
If you face this issue Unhandled rejection Error: EACCES: permission denied, open '/home/ubuntu/.npm/_cacache/index-v5/04/82/83016d88317bc219a7ecb0d1ef655bed9bb26a45696ad38e2590e0486bef' Unhandled rejection Error: EACCES: permission denied…