- Published
- Author
Soniya Rayabagi
CMD-SHIFT-L is a great productivity booster for VS Code. Lets you select all instances of the current selection and edit with multiple cursors. #VSCodetip #ProductivityHack
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.
CMD-SHIFT-L is a great productivity booster for VS Code. Lets you select all instances of the current selection and edit with multiple cursors. provider "aws" {
alias = "us_east"
region = "us-east-1"
}
provider "aws" {
alias = "us_west"
region = "us-west-1"
}
resource "aws_instance" "example" {
provider = aws.us_east
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
}
resource "aws_instance" "example_west" {
provider = aws.us_west
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
}us_east and us_west, representing the US East and US West regions, respectively. Then, we create instances using these providers, specifying the region-specific provider for each instance. This allows Terraform to manage resources in different regions using the same configuration file.brew install k9s, and access its intuitive interface by running k9sSpread operator in JavaScript is represented by three dots (...).
It's a useful syntax for manipulating arrays and objects in various ways.
Following are some of the use cases:-
Spread in Arrays:-
1. Copying Arrays: It allows you to create a new array by copying another array.
const originalArray = [1, 2, 3];
const copyArray = [...originalArray];
console.log(copyArray); // [1, 2, 3]
2. Concatenating Arrays: You can merge arrays together.
const array1 = [1, 2, 3];
const array2 = [4, 5, 6];
const mergedArray = [...array1, ...array2];
console.log(mergedArray); // [1, 2, 3, 4, 5, 6]
3. Adding Elements to Arrays: You can add new elements to an existing array.
const array1 = [1, 2, 3];
const newArray = [...array1, 4, 5, 6];
console.log(newArray); // [1, 2, 3, 4, 5, 6]
Spread in Objects:-
1. Copying Objects: It allows you to create a shallow copy of an object.
const originalObj = { name: 'John', age: 30 };
const copyObj = { ...originalObj };
console.log(copyObj); // { name: 'John', age: 30 }
2. Merging Objects: You can merge multiple objects into one.
const obj1 = { name: 'John' };
const obj2 = { age: 30 };
const mergedObj = { ...obj1, ...obj2 };
console.log(mergedObj); // { name: 'John', age: 30 }
3. Adding Properties to Objects: You can add new properties to an object.
const obj1 = { name: 'John' };
const newObj = { ...obj1, age: 30 };
console.log(newObj); // { name: 'John', age: 30 }
Function Arguments:
1. Spread can be used to pass an array as individual arguments to a function.
const numbers = [1, 2, 3];
const sum = (a, b, c) => a + b + c;
console.log(sum(...numbers)); // 6minikube service servicenamegit switch -c branch_name used in Git to create and switch to a new branch in one step.helm search hub <keyword> command is used to search for charts available in the Helm Hub, which is a centralized repository of Helm charts , keyword can be prometheus, grafana, nginx, postgresql etc.helm search hub <keyword> --max-col-width=0 this command displays the results without column width limitations.> symbol. Simply typing > filename truncates the file, removing all its previous content.chmod 777 <filename> is a command used to set permissions on a file or directory in Unix-like operating systems (including Linux and macOS). It grants full read, write, and execute permissions.❯ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
docker-desktop docker-desktop docker-desktop
* kind-kube-nginx-cluster kind-kube-nginx-cluster kind-kube-nginx-cluster
❯ kubectl config use-context docker-desktop
Switched to context "docker-desktop".kubectl config use-context docker-desktop we can also go with kubectx to switch between Kubernetes contextbrew install kubectxminikube dashboardmembers:readcurl -L \\
-H "Accept: application/vnd.github+json" \\
-H "Authorization: Bearer <YOUR-TOKEN>" \\
-H "X-GitHub-Api-Version: 2022-11-28" \\
https://api.github.com/orgs/ORG/members[
{
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
}
]base64 command can be used in Kubernetes to encode sensitive data such as passwords and API keys when creating secrets. By encoding the sensitive information in base64 format, it can be safely stored in Kubernetes secrets without exposing it in plaintext. This adds an additional layer of security to the sensitive data used by applications running in Kubernetes clusters. echo -n "some_password" | base64npm install or yarn install we might run into this error mentioned below:error /Users/<user>/project/node_modules/sharp: Command failed.
Exit code: 127
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)npm rebuild & then run npm install or yarn install .git stash want to store commit temporarily then , stashing will save your modifications and revert your working directory to its clean statedocker tag flix-rails:latest nishanthmathiyazhagan/flix-rails:latestdocker push nishanthmathiyazhagan/flix-rails:latestset(wait: 30.seconds) to ensure the sequential execution of dependent jobs. This can be achieved now by setting their concurrency to 1.Sidekiq.configure_server do |config|
config.capsule("capsule") do |cap|
cap.concurrency = 1
cap.queues = %w[capsule-queue]
end
endadults = User::User.where("age > ?", "18").pluck(:name)Showing page 14 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.