Unclassified interesting Tech Material - page 4
Next page:
https://swlearninglog.blogspot.com/2021/05/unclassified-interesting-tech-material.html
-3.
Ok may be one more:
Order of an Object's keys in JS:
https://dev.to/frehner/the-order-of-js-object-keys-458d
-2.
Manage timings / clock on your aws servers
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html
https://www.msystechnologies.com/blog/how-to-change-the-date-and-time-on-amazons-ec2-instance/
-1.
Such an amazing product
https://www.addtoany.com/
- all types of social sharing
0.
I'd be pissed too..
If I am taking time out from my family time, leisure time and contributing to open source.. to make things better for the generations to come.. and certain people for personal gains (in my opinion a paper is a personal gain.. especially in US universities where it is sort of a currency for profs and tenures and grants...).
I'd be mighty pissed too..
https://www.theverge.com/2021/4/30/22410164/linux-kernel-university-of-minnesota-banned-open-source
1.
Form builders:
- https://paperform.co/templates/permanent-makeup-consent-form
- https://www.typeform.com/templates/c/business/
2.
du command for hidden files !!
du -sch .[^.]*
3.
Linux utility to find out which process is rapidly doing disk read / write:
iotop
- very handy
- flags:
-a --> aggregate, show aggregates over runtime
-o --> only show processes where i/o is non-zero
4.
AWS Cli
- written python
- quiet convenient
- Configuring credentials for use:
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
- Download a folder from s3
cmd:
aws s3 sync s3://<source_bucket> <local_destination>
recursive:
aws s3 cp s3://BUCKETNAME/PATH/TO/FOLDER LocalFolderName --recursive
(designed mostly like rsync and scp)
taken from:
https://stackoverflow.com/a/18762381
5.
Awesome library for speed test..
I think it would be a good product to offer plug and play.
https://github.com/librespeed/speedtest
6.
Analyzing a nodejs core dump:
- https://github.com/nodejs/llnode
installation is a bit of an issue when using ubuntu
TODO: yet to figure it out the correct way to install it.
https://medium.com/sthima-insights/taming-the-dragon-using-llnode-to-debug-your-node-js-application-fc54c6efd0f1
7.
RabbitMQ memory management:
- https://www.rabbitmq.com/memory-use.html#breakdown-cli
- https://www.rabbitmq.com/disk-alarms.html
triggered when:
the free space of the drive or partition that the broker database uses goes below the set limit
- warning when alarm is set producers are blocked and connections to them are dropped.
- this alarm caused us to investigate if rabbitMQ was taking too much space, mostly thinking that rabbitmq is the one filling out the space.
- as it turns out.. it helped us pin-point an issue where another process was consuming an inordinate amount of memory and squeezing rabbitmq for free space
- this alarm sort of alerted us to the presence of the process and then.. iotop !!
- HTTP API for memory use management:
https://www.rabbitmq.com/memory-use.html#breakdown-http-api-curl
works well.
- Default directory locations
https://www.rabbitmq.com/relocate.html
- Change rabbitmq configs without restarting the server (mostly erlang magic !!):
https://www.rabbitmq.com/rabbitmqctl.8.html
- Delayed message exchange:
https://github.com/rabbitmq/rabbitmq-delayed-message-exchange
- works..
- not as great in performance as the other rabbitmq official plugins
- can do better
would like to contribute - especially to the admin reporting part
8.
Using Javascript objects as hashmaps to store and fetch functions / strings objects:
9.
Another python is awesome:
dict comprehension
https://docs.python.org/3/tutorial/datastructures.html#dictionaries
- Linux desktop notifications
https://www.devdungeon.com/content/desktop-notifications-linux-python
10.
Python pass by reference or pass by value ? well neither actually --> pass by name
https://robertheaton.com/2014/02/09/pythons-pass-by-object-reference-as-explained-by-philip-k-dick/
11.
Determine image file dimensions in px in browser before upload:
- without rendering the file
var _URL = window.URL || window.webkitURL; $("#file").change(function (e) { var file, img; if ((file = this.files[0])) { img = new Image(); var objectUrl = _URL.createObjectURL(file); img.onload = function () { alert(this.width + " " + this.height); _URL.revokeObjectURL(objectUrl); }; img.src = objectUrl; } });
- after rendering in img tag:
var img = document.getElementById('imageId');
var width = img.naturalWidth;
var height = img.naturalHeight;https://stackoverflow.com/a/47476281(works even if the img element is hidden)
12.
Recover lost files using only grep | This is neat:
http://blog.nullspace.io/recovering-deleted-files-using-only-grep.html
13.
For transactions in microservices:
- https://en.wikipedia.org/wiki/Two-phase_commit_protocol
- https://microservices.io/patterns/data/saga.html
14.
Fire events after your script loads:
https://stackoverflow.com/a/16231055
- also an interesting / common way of specifying callbacks before you library / util has loaded.
- make a global object say window.util = {}
- specify an on load complete window.util.onLoadComplete = () => {}
- when loading the lib do not overwrite the global window.util
but use something like Object.assign and call this.onLoadComplete when loading completes !!
Eg.
https://developer.tawk.to/jsapi/
and many others.. google-analytics JS api.. etc
15.
Angular formly: Angular dynamic forms from JSON schema !!
https://formly.dev/examples/advanced/json-schema
- this is one of the coolest angular implementations
- custom fields
- custom styling
- custom base styling (material, bootstrap, etc)
- server side rendering compatible
and many other useful features !
16.
Elasticsearch: Get mapping for an index
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html
- dynamic vs explicit mapping
https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html
17.
Google Tag manager tips and tricks:
- Differences between click classes and click-element --> css selector
https://stackoverflow.com/questions/43477486/differences-between-click-classes-and-click-element-in-google-tag-manager
click classes: strings
click element: DOM element instance
- affiliate sends a URL param, you need to trigger a pixel for them with a unique id for each lead creation
https://www.analyticsmania.com/post/track-affiliate-sales-with-google-tag-manager-and-google-analytics/
- A URL variable which fetches the value of say, utm_source;
- A Custom HTML tag which triggers a pixel iframe;
<iframe src="https://some-tracker.com/pixel?av=604a05e049bf723cfb74bc62&tracking_param={{clickUid}}" scrolling="no" frameborder="0" width="1" height="1"></iframe> - A trigger which fires that tag.
- custom variable to pick up clickUid for DOM element
https://www.analyticsmania.com/post/insert-variables-in-google-tag-manager/
https://www.analyticsmania.com/post/dom-element-variable-in-google-tag-manager/
https://www.analyticsmania.com/post/ultimate-google-tag-manager-data-layer-tutorial/
data attr in GTM, multiple ways to achieve this:
https://mixedanalytics.com/blog/value-data-attributes-javascript-gtm/
- This documentation is not very clear about DOM element
https://support.google.com/tagmanager/answer/7683362?hl=en
- Data laye
- pick up an attribute from a dom element
- tag manager debugging --> PREVIEW !!
the tool is awesome
18.
Google sheet tricks:
Nice custom format for getting lakh and crore commas for numbers
https://stackoverflow.com/a/34690816
[>9999999]##\,##\,##\,##0.00;[>99999]##\,##\,##0.00;##,##0.00
- replace commas in number string(happens when you past value for numbers that have commas)
=REGEXREPLACE(A2, "[,]", "")
taken from:
https://productivityspot.com/convert-text-to-numbers-google-sheets/
- this did not work for me
https://support.google.com/docs/answer/3094243?hl=en
https://support.google.com/a/users/answer/9308645?hl=en
19.
Some statistics and probability:
- Aggregate distributions:
https://www.vosesoftware.com/riskwiki/Aggregatedistributionsintroduction.php
- modelling call-center traffic and wait times:
https://en.wikipedia.org/wiki/Erlang_(unit)#Erlang_C_formula
https://en.wikipedia.org/wiki/Erlang_distribution#Waiting_times
- Central Limit Theorem
https://en.wikipedia.org/wiki/Central_limit_theorem
too many random factors ?! - safe to model it as Gaussian / Normal
20.
Matplotlib not rendering ?
warning: "matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure."
this one works:
https://stackoverflow.com/a/56675620
sudo apt-get install python3-tkvery informative about matplotlib backgrounds:
https://stackoverflow.com/a/43015816
21.
Poisson Distribution Explained
So nicely done !!
https://towardsdatascience.com/the-poisson-distribution-and-poisson-process-explained-4e2cb17d459
22.
Python misc:
- I never knew that the ** in **kwargs can expand dictionaries
Eg. from https://www.geeksforgeeks.org/python-merging-two-dictionaries/
dict_merged = {**dict1, **dict2}- ipython --> auto reload dependencies
In [1]: %load_ext autoreload In [2]: %autoreload 2
rest of the options: https://ipython.org/ipython-doc/stable/config/extensions/autoreload.html
- list concatenation
when python is just simply wonderful
a + b
https://stackoverflow.com/a/1720432
- always forget how to invoke the debugger:
import pdb; pdb.set_trace()
TODO: find out how to invoke ipython when the debugger kicks in.
- turn lists to queues
https://docs.python.org/3/tutorial/datastructures.html#using-lists-as-queues
- pretty printing
https://docs.python.org/3/library/pprint.html
23.
Pirple has some nice courses:
https://www.pirple.com/
- Keeping up with the Javascripts :D
funny title..
- Node.js master class
promises / boasts of covering the entire nodejs documentation.
But damn the simple page website...
Don't know what they are doing for SEO
22.
Kubernetes depricating docker ? What does it really mean.
https://towardsdatascience.com/kubernetes-is-deprecating-docker-in-the-upcoming-release-2a03d607934a
- docker image will be supported
- kubernetes will not use docker internally anymore
23.
ngFor iterate over object:
https://angular.io/api/common/KeyValuePipe
Nicely made iterator
24.
JSON Schema --> forms
- JSON forms
docs: https://jsonforms.io/docs/integrations/angular
working example: https://jsonforms-angular-seed.netlify.app/
- JSON form
code and docs: https://github.com/jsonform/jsonform
working example: https://jsonform.github.io/jsonform/playground/index.html?example=fields-wysihtml5
25.
Custom npm registry server:
https://verdaccio.org/en/
- cons:
no documentation on how to daemonize / run as a system process
TODO:
- write an entry about the correct config to get it running with systemctl and auto running when starting up.
26.
Very nicely made component !!
https://www.npmjs.com/package/angular-responsive-carousel
27.
restrict file types for input type="file"
This is a nice read:
https://www.joshmorony.com/using-html-file-input-for-uploading-native-ios-android-files/
28.
Javascript script - get directory of the script file being run :D
Quoting:
https://stackoverflow.com/a/9874415
"
process.cwd() returns the current working directory,i.e. the directory from which you invoked the node command.
__dirname returns the directory name of the directory containing the JavaScript source code file
"
Helps with jay-walking about the file system :D
29.
Angular base href ssr (server side rendering):
https://angular.io/api/common/APP_BASE_HREF
- pretty interesting the way dependency injection works with ssr
res.render(join(distFolder, 'start', indexHtml), { req, providers: [{ provide: APP_BASE_HREF, useValue: '/start' }] } );
From the angular sample code for ssr:
https://angular.io/generated/zips/universal/universal.zip
30.
When your ts files are getting highlighted with errors for no apparent reason VSCode:
Run the TypeScript: Restart TS server command
https://stackoverflow.com/a/60234067
Pretty handy this one :D
31.
Not delete output path when building angular ng build:--deleteOutputPath=false
where you can specify ng build to not delete the output path files
32.
General nice options to merge multiple configs angular ng build
https://github.com/angular/angular-cli/commit/65c2a1965f1b2d40ee2d1175846fe25aed6c8033
It's now possible to use multiple configurations by separating them with a comma: ``` ng build --configuration=one,two,three ``` They will be applied from left to right. If `--prod` is also present, it will be considered to be the first configuration and thus able to be overriden.
Neat !!
33.
Angular i18n:
- some nice options in angular.json
https://angular.io/guide/i18n#merge-aot
https://angular.io/guide/i18n#generate-app-versions-for-each-locale
34.
Angular - View Child
Nothing new in the content for me, but so well written:
https://blog.angular-university.io/angular-viewchild/
35.
Does anyone keep a Python3 venv in their home folder for general tinkering and system tasks ?
with say ipython installed :D
36.
Want to read you firefox session storage ?!
This did the trick for me:
https://unix.stackexchange.com/a/497861
def mozlz4_to_text(filepath): # Given the path to a "mozlz4", "jsonlz4", "baklz4" etc. file, # return the uncompressed text. import lz4.block bytestream = open(filepath, "rb") bytestream.read(8) # skip past the b"mozLz40\0" header valid_bytes = bytestream.read() text = lz4.block.decompress(valid_bytes) return text
(of course: cpaste is my hero)firefox_session_data = json.loads(mozlz4_to_text('/home/<user>/.mozilla/firefox/<profile>/sessionstore-backups/<file>'))Then may be output to a file and prettify in any editor (say VS Code or online).with open("./firefox_session_data.txt", "w") as f: f.write(json.dumps(firefox_session_data))
37.
Frameworks have started to make iteration over DOM efficient:
- Angular
https://angular.io/api/common/NgForOf
https://angular.io/api/core/TrackByFunction
- React
https://reactjs.org/docs/lists-and-keys.html#keys
- Vue
https://vuejs.org/v2/guide/list.html#Maintaining-State
This used to be a pain point for 2 way binding.
38.
Nice blog entry about what to take care of when updating wordpress:
https://bobcares.com/blog/update-wordpress-version/
39.
Angular 2+ cache buster / output hashing
(add a random unique string at end of file to subvert caching)
There are four possible values:
none: no hashing performed
media: only add hashes to files processed via [url|file]-loaders
bundles: only add hashes to the output bundles
all: add hashes to both media and bundles
Quoting from:
https://stackoverflow.com/questions/42506208/cache-buster-in-angular-2
40.
Converting angular app to ionic:
https://dev.to/a_shokn/how-to-convert-your-existing-angular-project-to-an-ionic-app-465l
41.
The only multipart form upload that works:
https://github.com/Vydia/react-native-background-upload
42.
.NET rising:
https://medium.com/@nicolasdorier/creating-a-cross-platform-desktop-app-in-net-core-part-one-be29079bcc71
43.
Linux keyrings:
https://itsfoss.com/ubuntu-keyring/
- would like to read more about this
-
44.
One link for your app on all platforms:
https://www.onelink.to/
45.
Compare and find node js libraries:
https://moiva.io/
https://www.npmtrends.com/
46.
Recursively update git repos
- good one:
https://gist.github.com/douglas/1287372
- this one is good too
https://stackoverflow.com/a/12495234
- this is the one I like the best
https://stackoverflow.com/a/28348077
47.
Good list of tools:
https://js.plainenglish.io/10-developer-tools-that-you-probably-need-to-use-1772982d3ad7
- Can I use ?
- RegEx101 --> always sue this for building, debugging, testing my regex
- Prettier --> use this in most my my projects
- Log Rocket --> never need this yet
- gitignore.io
- sentry --> used in most of my projects especially for client side crashes
48.
Peculiar case of model binding and angular change detection:
<input [ngModel]="bar" (ngModelChange)="modelChangeFn($event)">
How to replicate:
- in the modelChangeFn
- if new value is blank --> then set the model back to old value
- change detection will not trigger !!! --> because the old and new value did not change..
- even detectChanges() --> does not work.
(I have not tried using getter / setter)
49.
The full spectrum of Server Side Rendering:
https://developers.google.com/web/updates/2019/02/rendering-on-the-web
The final picture:
https://developers.google.com/web/updates/2019/02/rendering-on-the-web#wrapup
very well represented
For transferring http request-response that the server got to the client:
https://github.com/angular/universal/blob/master/docs/transfer-http.md
50.
New features in Javascript (ES12) in 2021
Quoting
#Promise.any
- Promise.any accepts an array of promises and resolves as soon as any of the supplied promises become resolved.
#
Numeric Separators
How is it useful? It makes our code more informative and readable.
#
a ||= b
a &&= b
a ??= b
not very impressed with this one.
51.
Lazy Load in Angular-Ionic
https://ionicframework.com/blog/how-to-lazy-load-in-ionic-angular/
52.
Working with ld+json / JSON-LD
Google's helpers
https://support.google.com/webmasters/answer/3069489?hl=en
https://support.google.com/webmasters/answer/3070233?hl=en
Online tool for validation:
https://json-ld.org/playground/
https://technicalseo.com/tools/schema-markup-generator/
- automated generator for common seo related jd-json schemas
Official documentation:
https://json-ld.org/
working with ld+json on angular
https://valor-software.com/articles/angular-and-seo-structured-data-for-rich-snippets.html
https://coryrylan.com/blog/angular-seo-with-schema-and-json-ld
https://medium.com/javascript-in-plain-english/how-to-use-json-ld-for-advanced-seo-in-angular-63528c98bb91
53.
Ionic generate resources for icons and splash screen:
Locally generate resource:
https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/#ios-specific-information
https://ionicframework.com/docs/cli/commands/cordova-resources
Good tool for generating online:
https://apetools.webprofusion.com/#/tools/imagegorilla
54.
Reading a keystore file:
keytool -v -list -keystore <path-to-file>
of course you need the password for decryption.
the command is pretty handy.
55.
SOLID -- Open-Closed
Good examples
https://medium.com/@alexandre.malavasi/why-is-the-open-closed-principle-so-important-bed2f2a0d4c7
56.
React native okhttp error causes the app the crash for no reason:
https://github.com/facebook/react-native/issues/27250#issuecomment-561840514
- it was difficult to diagnose
- finally found the okhttp error in the logcat for the app.
compile "com.squareup.okhttp3:okhttp:4.2.1"
compile "com.squareup.okhttp3:logging-interceptor:4.2.1"
compile "com.squareup.okhttp3:okhttp-urlconnection:4.2.1"
Some other references to this error:
https://www.gitmemory.com/issue/plaid/react-native-plaid-link-sdk/146/648286809
https://stackoverflow.com/questions/64351110/no-static-method-delimiteroffset-in-class-lokhttp3-internal-util
https://stackoverflow.com/questions/63365254/okhttp-error-during-react-navtive-get-request
https://github.com/plaid/react-native-plaid-link-sdk/issues/28#issuecomment-571655797
https://github.com/Vydia/react-native-background-upload/issues/220#issuecomment-705085530
57.
Injecting "document" server side:
1 2 3 4 5 6 7 import { Inject, Injectable } from '@angular/core'; import { DOCUMENT } from '@angular/common'; @Injectable() export class MyService { constructor(@Inject(DOCUMENT) private document: Document) {} }
This was quiet hard to find:
https://stackoverflow.com/a/60636562
"window" can also be injected in the same way.
58.
Angular Server Side Rendering - async / await:
(If you want your server to render info fetched by the APIs called)
https://github.com/angular/universal/blob/master/docs/gotchas.md#my-http-firebase-websocket-etc-wont-finish-before-render
Learn about the JS event loop:
https://javascript.info/event-loop
Nothing available in the official documentation:
https://angular.io/guide/universal
This one is incorrect to document that the express server will wait till the subscription is resolved
https://simply-how.com/angular-web-app-with-ssr-and-prerendering-example
or am I wrong ?
This one.. although not up-voted seems to be the right answer:
https://stackoverflow.com/a/53224226
59.
How to take notes in your browser:
https://web.uri.edu/teachonline/how-to-take-notes-in-your-browser/
I have book marked this..
https://www.investintech.com/resources/blog/archives/5674-chrome-notepad.html
History:
This tip originally comes from Jose Jesus Perez Aguinaga, web engineer and Javascript developer, who shared this tip on his blog, Coderwall.com, a few years ago. And it still works.
60.
Development lifecycle:
- Explicit questions
- - how / where does the feature start from ?(starting point, initial conditions)
- - do I have enough data / process to reach the starting point ?(FE perspective starts)- do I have click / hover / other transition information ?
- - do I have enough data to display this screen / input buttons / display texts ?
- - do I have click / hover / other transition (user action) information ? (in simple terms, answers to "what will happen when user does <any action here>")
- What validations to apply / how to handle errors?
- after effects of user action (this is the end of a user story)
- Implicit
- what other feature / pages / screens will this feature affect ? - Some thumb rules
- do not assume, confirm explicitly
- add to description / comment if new information comes to light
(again this is a crime after sprint has started)
- impact on other features existing / new .
- Requirements from others team members ( API ) .
- Verify with divagar about technical plan .
- give exact time estimate .
- if cannot completed in timeline then report to sanyam sir .
- Description points are got covert or not .
- Impacted features also need to tested .
- At least 4 happy path and one error path minimum . Can be changed depending on feature .
- Write tested paths in jira .
61.
React native webviews
https://github.com/react-native-webview/react-native-webview/blob/master/docs/Guide.md#add-support-for-file-download
62.
Dealing with framework maturity issues is just bleh !
https://stackoverflow.com/questions/40438986/keyboardavoidingview-with-scrollview
- things don't work as promised
- widgets are lacking in features
63.
Payment gateways now have multiple options for flows these days.
https://razorpay.com/docs/payment-gateway/web-integration/webapp/
- earlier it was only the redirect flows
64.
Cutting you test time:
https://www.browserstack.com/guide/parallel-testing-with-selenium
- execute in parallel
- may need extra dummy users
-
65.
I don't like such no-tech services:
https://help.instapage.com/hc/en-us/articles/115005969527-Passing-UTM-parameters-from-the-URL-to-a-hidden-field
- I would recommend not using these if you have an in house / even contracted tech team.
- inevitably you will encounter that is limited by the feature set of the product like instapage..
- and your tech team will be spending time learning the internals of this product
- figuring out twisted ways to do something simple, had the team themselves made the pages.
66.
React Native, publishing to google play :
https://reactnative.dev/docs/signed-apk-android
67.
Foray into new software tech
Cute language:
https://fsharp.org/learn/
TODO: checkout
State container JS:
https://redux.js.org/
State container - Angular
https://ngrx.io/
State container - Vue
https://vuex.vuejs.org/
Groovy - great for authoring domain specific language
https://groovy-lang.org/
https://www.bbvaapimarket.com/en/api-world/why-groovy-gaining-popularity-among-java-developers/
Rust -
https://www.rust-lang.org/
rust vs go
https://blog.logrocket.com/when-to-use-rust-and-when-to-use-golang/
Dart and Flutter:
https://dart.dev/overview
https://flutter.dev/docs/resources/architectural-overview
Akka and Kafka:
68.
Express JS has become quiet popular due to being very handy.. with http shortcuts:
Eg:
http://expressjs.com/en/api.html#res.redirect
Rest of the documentation:
http://expressjs.com/en/4x/api.html
69.
Xcode build and run app in emulator:
https://developer.apple.com/documentation/xcode/running_your_app_in_the_simulator_or_on_a_device
70.
Debugging Android Webview
https://developers.google.com/web/tools/chrome-devtools/remote-debugging/webviews
71.
Injecting / Init scripts in a react native web-view
https://github.com/react-native-webview/react-native-webview/blob/master/docs/Reference.md#injectedjavascriptbeforecontentloaded
Communication between JS and native code:
https://github.com/react-native-webview/react-native-webview/blob/master/docs/Guide.md#communicating-between-js-and-native
Also, it is very interesting that it is not a part of the standard package and is a community maintained component.
72.
Amazing Network Graph library
https://networkx.org/
73.
Amazing Graphing library:
https://graphviz.org/documentation/
Python wrapper:
https://pypi.org/project/pygraphviz/
74.
Get an Entity Relationship Diagram out of your django models:
- https://cyphon.readthedocs.io/en/latest/dev-guide/graphing-models.html
75.
Root Cause Analysis:
1. Define the problem.
2. Collect data.
3. Ask why. This means determining the factors that led to the problem.
4. Determine which factors are root causes and not just symptoms.
5. Identify corrective actions.
6. Identify solutions that will help the problem from recurring and do not cause other problems.
7. Implement the solution.
8. Determine if you can use this solution with other problems.
https://www.mindtools.com/pages/article/newTMC_80.htm
76.
Pytest has great documentation:
https://docs.pytest.org/en/latest/usage.html
77.
How to set all values of an object to null recursively in JavaScript?
https://stackoverflow.com/questions/45897879/
Answer I liked:
https://stackoverflow.com/a/62646380
import * as _ from 'lodash';
const bigObj = {"big": true, "deep": {"nested": {"levels": "many" } } };
const blankObj = _.cloneDeepWith(bigObj, (value) => {return _.isObject(value) ? undefined : null});
console.log(blankObj);78.
Cloning objects in JS:
https://www.samanthaming.com/tidbits/70-3-ways-to-clone-objects/
https://blog.logrocket.com/4-different-techniques-for-copying-objects-in-javascript-511e422ceb1e/
79.
After using for a long time:
Molecular is amazing, with a good ecosystem:
https://moleculer.services/modules.html
80.
CQRS and Event Sourcing:
https://www.baeldung.com/cqrs-event-sourcing-java
- this is like a read ahead logs used by DBs
-
81.
An alternative to data tables (https://datatables.net/)
ListJS
https://listjs.com/overview/
82.
Mini services:
https://thenewstack.io/miniservices-a-realistic-alternative-to-microservices/
- my opinion is: build your software in such a way that it is decoupled enough to be separated out into services quickly.
83.
Bottle Rocket - Linux for running containers - developed by AWS
https://github.com/bottlerocket-os/bottlerocket
https://aws.amazon.com/about-aws/whats-new/2020/08/announcing-general-availability-of-bottlerocket/
84.
https://dgraph.io/why-dgraph
- graphQL service candidate
83.
A good microservices framework in Java / Kotlin:
https://jooby.io/
84.
Search for a firefox tab suspender:
https://addons.mozilla.org/en-US/firefox/search/?q=suspend&platform=Linux&appver=80.0.1
TODO: still not found something as good as the great suspender
85.
Building microservices:
https://www.youtube.com/watch?v=Vmqh0xtvDME
TODO: watch
86.
Taiko:
https://docs.taiko.dev/overview/
https://docs.taiko.dev/overview/#taiko-vs-selenium
"
Taiko is very different from Selenium. Selenium uses
WebDriver a W3C standard.
Taiko uses Chrome DevTools Protocol.
"
87.
NodeJs vs Dino
https://thenewstack.io/how-node-js-is-addressing-the-challenge-of-ryan-dahls-deno/
88.
Zero Dollar Infra -- Frugal development
-
https://medium.com/better-programming/the-zero-dollar-infrastructure-stack-7c840a8b555b
89.
How NASA uses node.js
-
https://medium.com/hackernoon/ground-control-to-major-tom-how-nasa-uses-node-js-8d011e167436
-
https://openjsf.org/wp-content/uploads/sites/84/2020/02/Case_Study-Node.js-NASA.pdf
90.
Looking for a GUI client for Redis:
https://redislabs.com/blog/so-youre-looking-for-the-redis-gui/
- never tried yet:
https://www.npmjs.com/package/redis-commander
-- seems to be the recommended one to try
91.
Handy to change the root of the website:
https://www.w3schools.com/tags/tag_base.asp
92.
Steps for building cordova for google play store:
from:
https://stackoverflow.com/a/26450074
Step 1:
D:\projects\Phonegap\Example> cordova plugin rm org.apache.cordova.console --save
add the --save so that it removes the plugin from the config.xml file.
Step 2:
To generate a release build for Android, we first need to make a small change to the AndroidManifest.xml file found in platforms/android. Edit the file and change the line:
<application android:debuggable="true" android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
and change android:debuggable to false:
<application android:debuggable="false" android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
As of cordova 6.2.0 remove the android:debuggable tag completely. Here is the explanation from cordova:
Explanation for issues of type "HardcodedDebugMode": It's best to leave out the android:debuggable attribute from the manifest. If you do, then the tools will automatically insert android:debuggable=true when building an APK to debug on an emulator or device. And when you perform a release build, such as Exporting APK, it will automatically set it to false.
If on the other hand you specify a specific value in the manifest file, then the tools will always use it. This can lead to accidentally publishing your app with debug information.
Step 3:
Now we can tell cordova to generate our release build:
D:\projects\Phonegap\Example> cordova build --release android
Then, we can find our unsigned APK file in platforms/android/ant-build. In our example, the file was platforms/android/ant-build/Example-release-unsigned.apk
Step 4:
Note : We have our keystore keystoreNAME-mobileapps.keystore in this Git Repo, if you want to create another, please proceed with the following steps.
Key Generation:
Syntax:
keytool -genkey -v -keystore <keystoreName>.keystore -alias <Keystore AliasName> -keyalg <Key algorithm> -keysize <Key size> -validity <Key Validity in Days>
Egs:
keytool -genkey -v -keystore NAME-mobileapps.keystore -alias NAMEmobileapps -keyalg RSA -keysize 2048 -validity 10000
keystore password? : xxxxxxx
What is your first and last name? : xxxxxx
What is the name of your organizational unit? : xxxxxxxx
What is the name of your organization? : xxxxxxxxx
What is the name of your City or Locality? : xxxxxxx
What is the name of your State or Province? : xxxxx
What is the two-letter country code for this unit? : xxx
Then the Key store has been generated with name as NAME-mobileapps.keystore
Step 5:
Place the generated keystore in
old version cordova
D:\projects\Phonegap\Example\platforms\android\ant-build
New version cordova
D:\projects\Phonegap\Example\platforms\android\build\outputs\apk
To sign the unsigned APK, run the jarsigner tool which is also included in the JDK:
Syntax:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore <keystorename> <Unsigned APK file> <Keystore Alias name>
Egs:
D:\projects\Phonegap\Example\platforms\android\ant-build> jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore NAME-mobileapps.keystore Example-release-unsigned.apk xxxxxmobileapps
OR
D:\projects\Phonegap\Example\platforms\android\build\outputs\apk> jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore NAME-mobileapps.keystore Example-release-unsigned.apk xxxxxmobileapps
Enter KeyPhrase as 'xxxxxxxx'
This signs the apk in place.
Step 6:
Finally, we need to run the zip align tool to optimize the APK:
D:\projects\Phonegap\Example\platforms\android\ant-build> zipalign -v 4 Example-release-unsigned.apk Example.apk
OR
D:\projects\Phonegap\Example\platforms\android\ant-build> C:\Phonegap\adt-bundle-windows-x86_64-20140624\sdk\build-tools\android-4.4W\zipalign -v 4 Example-release-unsigned.apk Example.apk
OR
D:\projects\Phonegap\Example\platforms\android\build\outputs\apk> C:\Phonegap\adt-bundle-windows-x86_64-20140624\sdk\build-tools\android-4.4W\zipalign -v 4 Example-release-unsigned.apk Example.apk
Now we have our final release binary called example.apk and we can release this on the Google Play Store.
93.
Getting ionic, cordova, android to build on a linux PC
-> ANDROID_HOME --> deprecated
-> ANDROID_SDK_ROOT
https://stackoverflow.com/a/46112267
-x-x-x-x-
"
Could not find an installed version of Gradle either in Android Studio, or on your system to install the gradle wrapper
"
Had to install gradle manually:
- https://gradle.org/install/#manually
-x-x-x-x-x-
When you have multiple versions of JDK and the correct one is not getting picked by JAVA_HOME
sudo update-alternatives --config javac
https://stackoverflow.com/a/46071520
This probably has something to do with the fact that new Debian (and apparently Ubuntu) Java installations through the package manager do not use the JAVA_HOME enviroment variable to determine the location of the JRE. See this and this post for more info.
-x-x-x-x-x-
Cordova matching versions with android API.
https://cordova.apache.org/docs/en/latest/guide/platforms/android/#requirements-and-support
94.
Running crons with node:
https://github.com/kelektiv/node-cron
- a very cleverly written piece.
- all one needs to do it to keep the main loop alive with a pm2 or something..
- amazing
- simple
Ooh !! this is one smart way of utilising setTimeout on the node runtmie..
- AWS finally offering MAC ec2 instances:
A cute little promo video for it..
https://youtu.be/Pn3miC_tTH0
96.
Testing with Python:
BDD testing frameworks in python:
https://blog.testproject.io/2019/05/16/python-testing-framework-pros-cons/
"
None of these frameworks are perfect, but some have clear advantages. Overall, my top recommendation is pytest-bdd because it benefits from the strengths of pytest. I believe pytest is one of the best test frameworks in any language because of its conciseness, fixtures, assertions, and plugins. The 2018 Python Developers Survey showed that pytest is, by far, the most popular Python test framework, too. Even though pytest-bdd doesn’t feel as polished as behave, I think some TLC from the open source community could fix that.
Here are other recommendations:
- Use behave if you want a robust, clean experience with the largest community.
- Use pytest-bdd if you need to integrate with other plugins, already have a bunch of pytest tests, or want to run tests in parallel.
- Use radish if you want more programmatic control of testing at the Gherkin layer.
- Don’t use lettuce or freshen.
This is a very nice tutorial for pytest + selenium
https://blog.testproject.io/2019/07/16/web-ui-testing-python-pytest-selenium-webdriver/
My opinion:
- to me pytest seems like the best option
- gherkin is just too much of a hassle - write good logs for your test cases instead
- tox is great for automation https://tox.readthedocs.io/en/latest/
For appium:
https://testproject.io/
- is nice
- good community
- great features
Is free and almost all encompassing:
https://robotframework.org/#examples
97.
Should google-services.json be added to version control:
https://stackoverflow.com/questions/37358340/should-i-add-the-google-services-json-from-firebase-to-my-repository
- https://stackoverflow.com/a/37359108
- https://stackoverflow.com/a/42750187
- it anyway ends up in the APK and can be extracted.
98.
Phone number validation package from google:
https://www.npmjs.com/package/awesome-phonenumber
- light weight
- has never let me down for any country yet. (tried: India, Nepal, Dubai)
99.
DRAM Row hammering expoits
https://www.blackhat.com/docs/us-15/materials/us-15-Seaborn-Exploiting-The-DRAM-Rowhammer-Bug-To-Gain-Kernel-Privileges.pdf
Interesting read.
100.
https://try.digitalocean.com/app-platform/
Nice to see competitors catching up to Amazon.
https://aws.amazon.com/fargate/
continued from:
https://swlearninglog.blogspot.com/2020/05/unclassified-interesting-tech-material.html

Comments
Post a Comment