ReactNative
Sending messages ✉ between React Native ⟷ WebView
How to send messages from React Native code to the page loaded into WebView and back.
Bluetooth headset detection in React Native
How to detect Bluetooth headset connection/disconnection events and the headset name in React Native applications in Android and iOS.
Displaying custom UI controls in the React Native Gifted chat messages
A brief tutorial on how to render custom UI componenets inside the chat messages if you use Gifted Chat library for React Native.
Amplify
Accessing DynamoDB tables from Amplify Lambda functions
How to access AWS DynamoDB tables from Amplify Lambda Function: access policy configuration and resolving Dynamo table names.
Amplify guest users with Cognito records
Many applications require unauthorized/guest user accounts with (probably limited) access to server resources.
Amplify allows guest access but what if you need full-featured Cognito records for such users? What if you would want them to be converted later to the full accounts and keep user preferences and other associated server resources?
Git
How to rollback the last commit(s) in git
To rollback the last commit:
git reset HEAD~
It will revert your last commit. Your changes will stay locally so you are safe.
Fixing git repositiory files marked as modified on the external drive
My Mac has quite a small internal SSD and I use an external SSD to keep my source code.
Once you checkout your git repository to the external drive you might notice that all files are now marked as modified. If you do git diff you will see something like this:
Python
Optimizing SQLAlchemy PostgreSQL queries
One of our Flask-Admin pages became very slow recently and I had to investigate the reason.
The page contains a custom Flask-Admin ModelView
whish shows some data filtered
by the certain criteria. The underlaying table is quite large so it could be the
reason why the page is slow.
Unpacking Python list into multiple variables and a ‘catch-all’ list
TL;DR
a, *b, c = [1, 2, 3, 4, 5] # b gets [2, 3, 4]
React
PubNub with React Hooks and Contexts
I was recently looking for a sample how to use PubNub with custom React hooks and I didn’t find any complete example. Some of them were missing important details which I had to figure out later by myself. So here is a brief tutorial.
Avoiding deep nested tree of React Context Providers
This article gives you a way to convert your tree of React Context Provider components into a flat structure.
JavaScript
Image classification with WebRTC and TensorFlow.js
How to classify images from your webcam in the browser without a server using TensorFlow.js and WebRTC.
Jekyll
Installing jekyll on MacOS 10.13 High Sierra
TL;DR
curl -L https://get.rvm.io | bash -s stable
rvm install ruby-2.6.3
rvm use ruby-2.6.3
sudo gem install jekyll
React Native
Fixing ‘resource android:attr/colorError not found’ Android build error
If you get AAPT: error: resource android:attr/colorError not found
in your React Native Android build, add the following
code into your android/build.gradle
, allprojects
section:
WebBluetooth
Using Web Bluetooth API in Chrome Extensions
How to create a Chrome extension to connect Bluetooth devices using Web Bluetooth API.