- Published
- Author
- Satya
slack events api performs the events within 3 seconds if any exception happens then it retries again when the app is mentioned again.
At Codemancers, we believe every day is an opportunity to grow. This section is where our team shares bite-sized discoveries, technical breakthroughs and fascinating nuggets of wisdom we've stumbled upon in our work.
metadata provides additional information about the code. It begins with the character @ followed by either a reference to a compile-time constant or a call to a constant constructor.@Deprecated: This is used to indicate that a feature/method/class is deprecated and should not be used because it will be removed in future versions.@deprecated: This is similar to @Deprecated, with the difference being that a message can be passed with @Deprecated.@override: This is used to indicate that a method is intended to override a method from a superclass.@pragma: This is used to provide additional information to the Dart compiler.groupBy method introduced in ES12 can be used to group elements based on the values returned by the specified callback function. This can be useful when we want to categorize items into distinct groups.\rconst transactions = [\r
{ account: 'savings', amount: 12, date: '2023-01-01' },\r
{ account: 'checking', amount: 200, date: '2023-01-01' },\r
{ account: 'savings', amount: 500, date: '2023-02-01' },\r
{ account: 'checking', amount: 300, date: '2023-02-01' },\r
];groupBy to group these transactions by their account type:\rconst groupedTransactions = Object.groupBy(transactions, ({ account }) => account);{\r
savings: [\r
{ account: 'savings', amount: 12, date: '2023-01-01' },\r
{ account: 'savings', amount: 500, date: '2023-02-01' }\r
],\r
checking: [\r
{ account: 'checking', amount: 200, date: '2023-01-01' },\r
{ account: 'checking', amount: 300, date: '2023-02-01' }\r
]\r
}git log --branches --not --remotessetState() which also triggers a rebuild of the widget and its subtree. They can also rebuild when their parent widget or the widget hierarchy above them rebuilds.dynamic : dynamic is incredibly flexible. It tells Dart compiler to skip the type checking at compile time while type checking happens at run time. This is helpful when working with data of uncertain types.\r\r
dynamic value = 42;\r
value = 'Sujay';\r
print(value.isEven); // Error thrown during runtime\rObject : Object is the root class for all other classes. Its like a container like that can hold any value. Since Object is generic, you won't have access to specific methods or properties of value without type casting\r\r
Object value = 42;\r
print(value.isEven); // throws compile time error\rdotenv config gets the job done. Alternate approach is to have values in package.json that goes against the idea of having the environment variables as secrets and hidden from the repository code.conditionally call a hook which fetches data.react-query and if you do not want to create a wrapper component to fetch the data, react-query provides a good solution. react-query has an enabled option for its useQuery hook. We can conditionally enable or disable the query based on our needs.const { data, isLoading } = useQuery(
['user', userId],
fetchUserData,
{ enabled: isAuthenticated }
);useQuery is only executed if isAuthenticated is true. If isAuthenticated is false, the query is skipped.flutter:
assets:
- .env (path to the file where env is stored)void main() async {
await dotenv.load();
runApp(const MyApp());
}dotenv.env['APP_ENVIRONMENT']bin/rails generate generator initializer .create lib/generators/initializer
create lib/generators/initializer/initializer_generator.rb
create lib/generators/initializer/USAGE
create lib/generators/initializer/templates
create spec/generator/initializers_generator_spec.rb/etc/systemd/system/puma.servicesudo systemctl daemon-reloadsudo systemctl enable pumasudo service puma startsudo service puma statushistory | fzflayer , groups or frames.override. When we override an instance component and afterwards make modifications to the main component, the override does not change.say_something = -> { puts "This is a lambda" }scope method.class Fruit < ApplicationRecord
scope :with_juice, -> { where("juice > 0") }
enddouble is a method provided by the RSpec library for creating test doubles, also known as mocks. Test doubles are objects that stand in for real objects in your system during tests.tailwindcss-rails gem we don't need cssbundling-rails gem because tailwindcss-rails gem is a standalone version of Tailwind CSS that integrates with rails asset pipeline. It's a simpler and more direct alternative for rails applications because it doesn't require Node.js at all.Showing page 19 of 42
AI is everywhere but it's unclear which investments will actually move your metrics and which are expensive experiments.
Most AI projects fail at the data layer. Pipelines, quality, access all need work before LLMs can deliver value.
Your engineers are shipping product. They don't have capacity to also become AI specialists with production-grade experience.
Aging, undocumented codebases make AI integration slow, risky, and expensive. They need to move first.