- Which is the difference between
[1, 2, 3] & [3, 4, 5]
and[1, 2, 3] && [3, 4, 5]
? - Which is the difference between
[1, 2, 3] + [3, 4, 5, 6]
and[1, 2, 3] << [3, 4, 5, 6]
? - What do you get with
[5, 3, 1, [2, 10]].flatten
?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are a world-class Staff Engineer in React, Typescript, Next.js and Tailwind CSS. Your role is to generate complete, | |
functional front-end code based on the user's specifications. Adhere to these guidelines: | |
<CleanCode> | |
Don't Repeat Yourself (DRY) | |
Duplication of code can make code very difficult to maintain. Any change in logic can make the code prone to bugs or can | |
make the code change difficult. This can be fixed by doing code reuse (DRY Principle). | |
The DRY principle is stated as "Every piece of knowledge must have a single, unambiguous, authoritative representation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Retry count | Retry Time | Total Cumulative Time | Total Cumulative Days | |
---|---|---|---|---|
0 | 0:00:00 | 0:00:00 | 0.0 | |
1 | 0:00:16 | 0:00:16 | 0.0 | |
2 | 0:00:31 | 0:00:47 | 0.0 | |
3 | 0:01:36 | 0:02:23 | 0.0 | |
4 | 0:04:31 | 0:06:54 | 0.0 | |
5 | 0:10:40 | 0:17:34 | 0.0 | |
6 | 0:21:51 | 0:39:25 | 0.0 | |
7 | 0:40:16 | 1:19:41 | 0.1 | |
8 | 1:08:31 | 2:28:12 | 0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In Cloudwatch dashboards, the widget we add are taking too much space. | |
// use sth like stylebot to apply it | |
.SplitPane-module__splitPane___334V0 { | |
display: flex; | |
min-height: 0; | |
} | |
.react-grid-item { | |
height: 300px !important; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# UPDATED 17 February 2019 | |
# Redirect all HTTP traffic to HTTPS | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name www.domain.com domain.com; | |
return 301 https://$host$request_uri; | |
} | |
# SSL configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inherit_from: | |
- .rubocop_todo.yml | |
# inherit_gem: | |
# rubocop-rails: | |
# - config/rails.yml | |
require: rubocop-rspec | |
AllCops: | |
DisplayCopNames: true | |
Exclude: | |
- db/schema.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
watch -n 300 afplay /System/Library/Sounds/Purr.aiff -v 11 0<&- &>/dev/null & |
Add some gems to your Gemfile:
group :development, :test do
gem 'database_cleaner'
gem 'rspec-rails'
end
group :test do
gem 'capybara'
gem 'selenium-webdriver'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def reverse(string) | |
if string.size > 1 | |
string[-1] + reverse(string[0..-2]) | |
else | |
string | |
end | |
end | |
puts reverse "Francesco" |
NewerOlder