My 24th Dart package:
https://pub.dev/packages/wif_workaround
A workaround to use Workload Identity Federation with
You normally use
This package allows you to use Workload Identity Federation if you have locally installed gcloud CLI.
https://pub.dev/packages/wif_workaround
A workaround to use Workload Identity Federation with
googleapis_auth, calls gcloud CLI to get the access token.You normally use
googleapis_auth package to connect to Google Cloud services. It works with service account keys and metadata server, but not with local keys obtained with Workload Identity Federation.This package allows you to use Workload Identity Federation if you have locally installed gcloud CLI.
Dart packages
wif_workaround | Dart package
A workaround to use Workload Identity Federation with googleapis_auth,
calls gcloud CLI to get the access token.
calls gcloud CLI to get the access token.
π4π₯3β€1
Part 2. Earlier we made a simple container and deployed it manually. Time to automate things and take it to the production level:
https://medium.com/@alexey.inkin/making-github-workflows-to-deploy-to-gke-with-terraform-and-workload-identity-federation-074ac83b899c
This tutorial:
- Creates persistent environments.
- Uses Terraform for declarative management of cloud resources.
- Uses GitHub Workflows to automate deployment.
- Creates transient copies of the system to run tests on them.
- Uses Workload Identity Federation to avoid any use of service account keys.
DevOps is surprisingly hard, and it took me 1.5 months to learn and write this. These GitHub workflows failed 108 times for me while debugging, so this should save you tons of try and errors.
https://medium.com/@alexey.inkin/making-github-workflows-to-deploy-to-gke-with-terraform-and-workload-identity-federation-074ac83b899c
This tutorial:
- Creates persistent environments.
- Uses Terraform for declarative management of cloud resources.
- Uses GitHub Workflows to automate deployment.
- Creates transient copies of the system to run tests on them.
- Uses Workload Identity Federation to avoid any use of service account keys.
DevOps is surprisingly hard, and it took me 1.5 months to learn and write this. These GitHub workflows failed 108 times for me while debugging, so this should save you tons of try and errors.
π4π₯2
β What would be the best way to implement CI/CD for flutter apps?
π °οΈ The most tricky part in CI/CD is automated testing. Otherwise, just building and deploying is relatively easy. Then, testing on the Flutter's part isn't hard. In most apps, all you need is click through some use cases. Much harder is the backend to which your app talks. You typically need a copy of the system with its storage, message queues, and all the rest. What of that you can isolate or mock varies widely. So start your CI/CD with the backend. When it's done, its specific architecture usually will hint a straightforward way to add Flutter or any other client on top of it.
See the recent article for the example for the backend.
π °οΈ The most tricky part in CI/CD is automated testing. Otherwise, just building and deploying is relatively easy. Then, testing on the Flutter's part isn't hard. In most apps, all you need is click through some use cases. Much harder is the backend to which your app talks. You typically need a copy of the system with its storage, message queues, and all the rest. What of that you can isolate or mock varies widely. So start your CI/CD with the backend. When it's done, its specific architecture usually will hint a straightforward way to add Flutter or any other client on top of it.
See the recent article for the example for the backend.
π6
I made a tiny package to dump the last HTTP request. It helps a lot in debugging failed requests.
https://pub.dev/packages/http_log
https://pub.dev/packages/http_log
Dart packages
http_log | Dart package
A logger for HTTP requests, stores the last request, can pretty-print it in cURL or raw
π₯5π4
My new article: The 2 new lints in Dart 3.4.
https://medium.com/p/5596edbf3746
https://medium.com/p/5596edbf3746
Medium
The 2 new lints in Dart 3.4
Improve your documentation formatting and clean up deprecated βpart ofβ directives.
π₯3
Playing with Dart 3.5 macros already? I made a CLI tool to show augmentation for a given source file if your IDE is buggy or does not yet support macros:
https://pub.dev/packages/show_augmentation
https://pub.dev/packages/show_augmentation
π₯2
Playing with Dart 3.5 macros already?
Anonymous Poll
8%
I made my own macros already
3%
I tried JsonCodable and want to make my own macros
0%
I just tried JsonCodable
32%
I've heard about Dart 3.5 macros and want to try them
29%
Wow, I never heard of Dart 3.5 macros
29%
I don't care / will wait until it's stable
A first hands-on with custom macros: https://medium.com/@alexey.inkin/creating-your-own-macro-instead-of-code-generation-in-dart-3-5-27274f8a5bf6
Medium
Creating your own macro instead of code generation in Dart 3.5
What a macro is, how it works, learning from JsonCodable macro, and creating our own hello-world macro.
π₯2β€1
I have re-written enum_map package with macros. This package takes an
The most straightforward use of the package is to make sure your Flutter tabs never fall out of sync with the tab controller and tab headers. I use it in every Flutter project in the last ~2 years. The highest it made to is Apache Beam with 7.7k stars. More in my article "Compile-time safety for Flutter tabs" from before.
With macros, you no longer need code generation with build_runner. You just add an annotation to an enum and instantly get the map class ready to use.
Check out the pre-release version.
enum and creates a map class that gives you a compile-time guarantee that the map has an entry for each of the enum constants. No more bangs after getting a value from a map.The most straightforward use of the package is to make sure your Flutter tabs never fall out of sync with the tab controller and tab headers. I use it in every Flutter project in the last ~2 years. The highest it made to is Apache Beam with 7.7k stars. More in my article "Compile-time safety for Flutter tabs" from before.
With macros, you no longer need code generation with build_runner. You just add an annotation to an enum and instantly get the map class ready to use.
Check out the pre-release version.
Dart packages
enum_map | Dart package
A Map with compile-time check that every enum constant has an entry in it.
π11π₯1
Every time I think something is too trivial to go with classes I end up rewriting it with classes. Tomorrow I will lose 1 hour changing
There is "Domain-Driven Development" (DDD) principle. It says to create a classes for logically distinguished things. For instance, you should have classes
Don't neglect DDD.
List<double> into TimeSeries because it "suddenly" needed to be aware of timestamps.There is "Domain-Driven Development" (DDD) principle. It says to create a classes for logically distinguished things. For instance, you should have classes
Password, Url, Username, etc. and not use just String for them. If I followed it and created TimeSeries from the beginning since I was dealing with a time series, I would have saved 1 hour of my life.Don't neglect DDD.
π7β€5
Alexey Inkin | Flutter GDE
A first hands-on with custom macros: https://medium.com/@alexey.inkin/creating-your-own-macro-instead-of-code-generation-in-dart-3-5-27274f8a5bf6
The second part on macros, as I promised:
https://medium.com/@alexey.inkin/deep-dive-into-writing-macros-in-dart-3-5-a1dd50914a7d
This time, it's everything I learned in a month of playing with them, and I dive into all aspects of writing and testing using my Args macro as an example.
May those who didn't unfollow after the Spanish post be rewarded.
https://medium.com/@alexey.inkin/deep-dive-into-writing-macros-in-dart-3-5-a1dd50914a7d
This time, it's everything I learned in a month of playing with them, and I dive into all aspects of writing and testing using my Args macro as an example.
May those who didn't unfollow after the Spanish post be rewarded.
Medium
Deep dive into writing macros in Dart 3.5
I spent a monthβs vacation full-time playing with macros, and hereβs all you need to start fast.
π1π₯1
What do you think is the world's single most fundamental problem that all others are induced by? The one you can't ask "why?" to get closer to the root.
If you have Twitter, please reply there. Otherwise, here in a comment.
https://x.com/alexeyinkin/status/1820797300588884114?s=46
If you have Twitter, please reply there. Otherwise, here in a comment.
https://x.com/alexeyinkin/status/1820797300588884114?s=46
π€2
How to write golden tests for your code generators:
https://medium.com/flutter-senior/writing-golden-tests-for-code-generation-in-dart-d2951e25ce00
https://medium.com/flutter-senior/writing-golden-tests-for-code-generation-in-dart-d2951e25ce00
Medium
Writing golden tests for code generation in Dart
Some time ago I improved source_gen_test package by Kevin Moore to support external golden files. The package is used to write tests forβ¦
π1π₯1
The Responsibility of the Tech Community over Telegram Prosecution
Telegram & Pavel Durov are under attack over South Korea deep fake crisis. A tech community has an obligation to the public to protect the freedoms by explaining this case.
Any official calling to stop the deep fake crisis is either incompetent or double-playing. The generation is done with dual-purpose open-source software that can be installed on any computer. Once open-source is out there, it canβt be unwritten. Itβs omnipresent. And itβs also used on every phone in the world for legitimate purposes like hiding your wrinkles. Itβs like campaigning against Photoshop because someone does naughty stuff with it.
Moreover, with hardware getting better, in 10 years anyone will be able to deep-fake anything in a split-second without any restrictions. Itβs just the new world we have to learn to live in where anyone can be in porn, and itβs up to a beholder to ignore it, like today you ignore photoshopped horns on your head.
In 10 years we will adapt, but until then the authorities are free to manipulate us into agreeing to ban everything they point the public to blame.
With the French case, Telegram was a mean of communication for some crimes, but with deep fake generation itβs just an entry point for a purchase, and the generation is done on 3rd party backends. That purchase is otherwise trivial with disposable domain names, and has been for decades for other black market info like private data & card numbers.
If an official desnβt know that, they must be fired for incompetence. If they do, they must be jailed for abusing their power to prosecute and for conspiracy to push you into using other software that spies on you and gives them access.
I have a set of questions in my mental toolkit I find most rewarding to ask. One of them is:
If this battle is staged, then what is it staged to hide?
Recursively ask it until you see the obvious.
In Tech, we understand that. It's our responsibility to educate others on this to retain our freedoms.
Telegram & Pavel Durov are under attack over South Korea deep fake crisis. A tech community has an obligation to the public to protect the freedoms by explaining this case.
Any official calling to stop the deep fake crisis is either incompetent or double-playing. The generation is done with dual-purpose open-source software that can be installed on any computer. Once open-source is out there, it canβt be unwritten. Itβs omnipresent. And itβs also used on every phone in the world for legitimate purposes like hiding your wrinkles. Itβs like campaigning against Photoshop because someone does naughty stuff with it.
Moreover, with hardware getting better, in 10 years anyone will be able to deep-fake anything in a split-second without any restrictions. Itβs just the new world we have to learn to live in where anyone can be in porn, and itβs up to a beholder to ignore it, like today you ignore photoshopped horns on your head.
In 10 years we will adapt, but until then the authorities are free to manipulate us into agreeing to ban everything they point the public to blame.
With the French case, Telegram was a mean of communication for some crimes, but with deep fake generation itβs just an entry point for a purchase, and the generation is done on 3rd party backends. That purchase is otherwise trivial with disposable domain names, and has been for decades for other black market info like private data & card numbers.
If an official desnβt know that, they must be fired for incompetence. If they do, they must be jailed for abusing their power to prosecute and for conspiracy to push you into using other software that spies on you and gives them access.
I have a set of questions in my mental toolkit I find most rewarding to ask. One of them is:
If this battle is staged, then what is it staged to hide?
Recursively ask it until you see the obvious.
In Tech, we understand that. It's our responsibility to educate others on this to retain our freedoms.
π5π2
How often do you have issues with iOS? I spent an hour on a trivial thing today because Flutter is not good at finding and fixing iOS misconfigurations. I hit something like that every time I upgrade something. So I filed a feature request to improve this: https://github.com/flutter/flutter/issues/154663
If you have suggestions to improve Flutter tooling for iOS that do not qualify as separate issues, you can post them as comments there.
If you have suggestions to improve Flutter tooling for iOS that do not qualify as separate issues, you can post them as comments there.
GitHub
Require less iOS knowledge to build a Flutter app Β· Issue #154663 Β· flutter/flutter
Use case I find that the tools for building a Flutter app for iOS are too thin of a layer above the native tools for building for iOS. A few examples: When packages get their dependencies wrong, th...
π2
Got an excellent interview question for you.
What will happen and why?
Enjoy.
What will happen and why?
Enjoy.
void main() {
final future = Future.error('My error');
future.catchError((e, st) => print('Caught'));
future.whenComplete(() => print('whenComplete()'));
}Last Sunday, I moved to The United States as a permanent resident under EB-1A program of extraordinary ability in science. I'm waiting for my green card to arrive by mail in a few months.
Here is my complete petition with just a few private things blacked out, the process of writing it, my strategy for each criterion, and all the reasoning:
https://github.com/alexeyinkin/eb-1a/tree/main/2-petition
And here is the entire process, every form I filled out, and every piece of interaction with each of the United States bodies I went through:
https://github.com/alexeyinkin/eb-1a/tree/main/1-process
I will be updating it with the few steps left as I will receive my SSN card and the green card.
To those of you who want to do the same, here's how I can help:
https://github.com/alexeyinkin/eb-1a/tree/main/4-help
I made a dedicated chat to answer any of your questions on this program: @eb1a_chat
Please join it even if just to say "Hi!"
I like to hear from those who want to come to this great country!
Here is my complete petition with just a few private things blacked out, the process of writing it, my strategy for each criterion, and all the reasoning:
https://github.com/alexeyinkin/eb-1a/tree/main/2-petition
And here is the entire process, every form I filled out, and every piece of interaction with each of the United States bodies I went through:
https://github.com/alexeyinkin/eb-1a/tree/main/1-process
I will be updating it with the few steps left as I will receive my SSN card and the green card.
To those of you who want to do the same, here's how I can help:
https://github.com/alexeyinkin/eb-1a/tree/main/4-help
I made a dedicated chat to answer any of your questions on this program: @eb1a_chat
Please join it even if just to say "Hi!"
I like to hear from those who want to come to this great country!
π₯27π9β€5π3
pub.dev now shows the download count for packages.
This is experimental. Go here to enable it: https://pub.dev/experimental
Here are my humble stats.
This is experimental. Go here to enable it: https://pub.dev/experimental
Here are my humble stats.
π₯4β€1π1
Media is too big
VIEW IN TELEGRAM
Can you help me reach Elon or Vivek with my application for a job at the Department of Government Efficiency?
I want to optimize the operations in legal work immigration.
Getting this green card was long, expensive, and exhausting. I spent $7k even without a lawyer, spent 4 months full-time writing my petition of over 500 pages long (I also published it, take a look [1]), and waited for 11 months after that to be able to come to the United States.
I want to cut this from months to days for those who follow, because America needs to greatly expand legal skilled work immigration, especially after the border with Mexico is closed. The United States loses over a billion in GDP every year from delaying the workers who are already found qualified.
And I have a plan that pays for itself from taxes right away. Check it out as well [2].
To give you an idea of how bad things are in legal immigration:
- You won't believe it, but there is a quota in the extraordinary ability program. And it's not just the high bar, but even the number of people who have already proven they qualified is limited by Congress. Last year, the quota depleted before the end of the year, and the whole machine halted for over a month. What is the purpose of that?
- To make it worse, there is a quota per country of birth. People born in India currently wait 3 years longer than others under the highest program for most talented people, and 10 years longer under the second-most preferred program. This is racist. Not to mention that every petitioner must prove that their immigration will significantly benefit the United States, so we are talking about those who have proven that already. But the law says: 'We got it, we will benefit significantly, now wait for 12 years. In the meantime, your kids will grow up, and you won't be able to take them with you, even though they qualify now. Too bad that the wait is that long'. Crazy.
- Next, a doctor of the Olympic team of a large Asian country could not evaluate her diploma and is unable to work in the United States. It's nearly impossible for doctors to immigrate and work here, and that's a major healthcare cost driving factor. In my homeland, an MRI scan costs $50, and many do it out of pocket multiple times a year for even minor issues, but in the US it costs thousands and is the last resort after weeks of patient's suffering.
See more in the video.
Dear Elon & Vivek, please consider me for DoGE! We need many right people here fast. Make immigration great again!
To help me reach Elon or Vivek, please share:
This post on X: https://x.com/AlexeyInkin/status/1867992122827182233
Or this YouTube video anywhere: https://www.youtube.com/watch?v=M_d3k_6Rw5c
Or this on LinkedIn: https://www.linkedin.com/feed/update/urn:li:activity:7273770178067255296/
[1] My petition: https://github.com/alexeyinkin/eb-1a/tree/main/2-petition
[2] My plan: https://github.com/alexeyinkin/eb-1a/tree/main/3-improvements
X: https://x.com/AlexeyInkin
LinkedIn: https://www.linkedin.com/in/alexey-inkin/
Instagram: https://www.instagram.com/alexey.inkin/
GitHub: https://github.com/alexeyinkin
Telegram: https://t.me/ainkin_com
I want to optimize the operations in legal work immigration.
Getting this green card was long, expensive, and exhausting. I spent $7k even without a lawyer, spent 4 months full-time writing my petition of over 500 pages long (I also published it, take a look [1]), and waited for 11 months after that to be able to come to the United States.
I want to cut this from months to days for those who follow, because America needs to greatly expand legal skilled work immigration, especially after the border with Mexico is closed. The United States loses over a billion in GDP every year from delaying the workers who are already found qualified.
And I have a plan that pays for itself from taxes right away. Check it out as well [2].
To give you an idea of how bad things are in legal immigration:
- You won't believe it, but there is a quota in the extraordinary ability program. And it's not just the high bar, but even the number of people who have already proven they qualified is limited by Congress. Last year, the quota depleted before the end of the year, and the whole machine halted for over a month. What is the purpose of that?
- To make it worse, there is a quota per country of birth. People born in India currently wait 3 years longer than others under the highest program for most talented people, and 10 years longer under the second-most preferred program. This is racist. Not to mention that every petitioner must prove that their immigration will significantly benefit the United States, so we are talking about those who have proven that already. But the law says: 'We got it, we will benefit significantly, now wait for 12 years. In the meantime, your kids will grow up, and you won't be able to take them with you, even though they qualify now. Too bad that the wait is that long'. Crazy.
- Next, a doctor of the Olympic team of a large Asian country could not evaluate her diploma and is unable to work in the United States. It's nearly impossible for doctors to immigrate and work here, and that's a major healthcare cost driving factor. In my homeland, an MRI scan costs $50, and many do it out of pocket multiple times a year for even minor issues, but in the US it costs thousands and is the last resort after weeks of patient's suffering.
See more in the video.
Dear Elon & Vivek, please consider me for DoGE! We need many right people here fast. Make immigration great again!
To help me reach Elon or Vivek, please share:
This post on X: https://x.com/AlexeyInkin/status/1867992122827182233
Or this YouTube video anywhere: https://www.youtube.com/watch?v=M_d3k_6Rw5c
Or this on LinkedIn: https://www.linkedin.com/feed/update/urn:li:activity:7273770178067255296/
[1] My petition: https://github.com/alexeyinkin/eb-1a/tree/main/2-petition
[2] My plan: https://github.com/alexeyinkin/eb-1a/tree/main/3-improvements
X: https://x.com/AlexeyInkin
LinkedIn: https://www.linkedin.com/in/alexey-inkin/
Instagram: https://www.instagram.com/alexey.inkin/
GitHub: https://github.com/alexeyinkin
Telegram: https://t.me/ainkin_com
π₯13π2π2β€1