- Published
- Author
Soniya Rayabagi
models generating a model and migration , running a migration, CRUD records in the database different ways.Connecting
MVC the goal is to show information that's in the database.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.
models generating a model and migration , running a migration, CRUD records in the database different ways.MVC the goal is to show information that's in the database.models generating a model and migration , running a migration, CRUD records in the database different ways.views-and-controllers all the major stages a request goes through when it enters a Rails app. Like adding route to handle requests , generating controller , worked on first view template .rm -rf .git by running this command you are essentially deleting the entire Git repository, including all the commit history, configuration files, and any other Git-related data, from the current directory as it permanently removes the Git version control .var, final and constvar is used for dynamic typing, allowing the type of the variable to be inferred at runtime.final is used to declare a variable that can only be assigned once. It must be initialised when declared, and its value cannot change.const is used to declare a compile-time constant. It must be initialised with a constant value, and its value cannot change.emitDecoratorMetadata that, when enabled, emits metadata about the types used in our code. This metadata is accessible at runtime using reflect-metadata library.class-transformer and class-validator leverage this metadata to transform plain JavaScript objects into instances of specific classes and validate them against certain rules. Even though TypeScript types don't exist at runtime, the information about those types does, this provide us a more structured and safe way of working with data in JavaScript.await new Promise((r) => setTimeout(r, 2000));const and final cannot be reassigned, there is a subtle difference between them.const variables are used for compile-time constants whereas final variables are used for run-time constants.const current_time = new DateTime.now() // DON'T do it as the value is computed at run time
const name = 'Rahul' // DO it as the value is known at compile timefinal in such casesgitignore to add the .DS_STORE files into it by deleting the ds.store file first , and then using echo ".DS_Store" >> .gitignore to add the .ds_store file.git url to clone repo instead of https will not ask password on every git push/pullgit url to clone repo instead of https will not ask password on every git push/pullradio input in a React Hook form and attempted to pass a boolean value, however when i submit the form, i receive the typeof value as a string. Knowing that RHF has valueAsNumber to convert it as number. I thought that setValueAs was a generic way to allow any conversion but I can't make it work.boolean value from a RHF radio input.setValueAs approach, which I have previously tried, only functions with text input (such as type="text" or type="number"). Even if the value for a radio button is a string, it doesn't function.<Controller
defaultValue={false}
control={control}
name="booking_for_someone"
render={({ field: { onChange, onBlur, value, ref } }) => (
<label className="booking-for-someone">
<span className="f-semibold">{t("I'm Booking For")}</span>
<div>
<input
type="radio"
onBlur={onBlur}
onChange={() => onChange(false)}
checked={value === false}
inputRef={ref}
id="myself"
/>
<label
htmlFor="myself"
>
{t("Myself")}
</label>
</div>
<div >
<input
type="radio"
className="w-16 h-16 rounded-full accent-blue"
onBlur={onBlur}
onChange={() => onChange(true)}
checked={value === true}
inputRef={ref}
id="someone-else"
/>
<label
htmlFor="someone-else"
>
{t("Someone Else")}
</label>
</div>
</label>
)}
/>verification links, subscription updates, marketing etc. we can create separate topics for each type of email. This allows us to manage the subscription preferences for each type of email separately.{{amazonSESUnsubscribeUrl}} placeholder in our emails: AWS SES will automatically replace the {{amazonSESUnsubscribeUrl}} placeholder in the email with the actual unsubscribe URL. OTP verification and password reset emails, even after they opt-out of other emails, we can use separate contact lists and topics for these types of emails or we should not pass ListManagementOptions in these emails.{
"Destination": {
"ToAddresses": ["[email protected]"]
},
"Message": {
"Body": {
"Html": {
"Charset": "UTF-8",
"Data": "<body> // Email content... <p>If you no longer wish to receive our emails, please <a href=" {{amazonSESUnsubscribeUrl}}">unsubscribe</a></p></body>"
}
},
"Subject": {
"Charset": "UTF-8",
"Data": "Email subject"
}
},
"Source": "[email protected]",
"ListManagementOptions": {
"ContactListName": "contact_list_name",
"TopicName": "Marketing"
}
}"Hello" stored in a. Instead, it creates a new variable b that references the same string object in memory as a. Both a and b will point to the same memory location, which means they will hold the same value and any changes made through one variable will be reflected in the other.b.upcase!puts a # Output: "HELLO"
puts b # Output: "HELLO"dup method or string manipulation methods to create a new string object with the same content.mysql> use your_local_db;
mysql> source your_db_backup_dump.sql;mj-preview tag. This tag allows us to customize the preview text that appears in the recipient's inbox.<mjml>
<mj-head>
<mj-preview>Check out our latest deals!</mj-preview>
</mj-head>
<mj-body>
<!-- email content -->
</mj-body>
</mjml>git branch -D <branch name>git checkout maingit checkout -b <branch name>git commit -m "Your commit message"git push origin <branch name> -f-f flag in the ‘git push’ command, you force-push the changes to the branch on the remote repository. This erases the previous commits from the branch, giving you a fresh start with your new commit.”Showing page 21 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.