Pro: W269N-WFGWX-YVC9B-4J6C9-T83GX
Pro N: MH37W-N47XK-V7XM9-C7227-GCQG9
Home: TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
Home N: 3KHY7-WNT83-DGQKR-F7HPR-844BM
I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.
So below I made a list of leetcode problems that are as close to grokking problems as possible.
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Document</title> | |
| <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" | |
| integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" | |
| crossorigin=""/> | |
| <script src="https://unpkg.com/[email protected]/dist/leaflet.js" |
Fetch the last messages in each group by the attribute name
SELECT m1.*
FROM messages m1 LEFT JOIN messages m2
ON (m1.name = m2.name AND m1.id < m2.id)
WHERE m2.id IS NULL;
This file contains hidden or 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
| /* | |
| * the first implementation is simpler but not much smart because, if a pattern long than value is passed | |
| * to function all remaining pattern will be write to outputValue and not crop immediately | |
| * for all purposes use second function, the first one is only a option more compact for understanding | |
| */ | |
| function makeString(value, pattern) { | |
| let position = 0 | |
| return pattern.replace(/#/g, () => { | |
| if(position >= value.length) { | |
| return '' |
This file contains hidden or 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
| const camelToSnakeCase = str => str.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`); | |
| function mapFieldsToStorageName(name) { | |
| const map = new Map() | |
| map.set('userId', 'owner_id') | |
| return map.get(name) ?? camelToSnakeCase(name) | |
| } | |
| function generateQuery(tableName, filters, ordering, options) { | |
| const values = [] |
# generate .crt and .key files
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt
# generate strong Diffie-Hellman group
sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048To create a custom mouse script in nautilus just put your script in ~/.local/share/nautilus/scripts/ and make sure it's executable.
This file contains hidden or 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
| var linhas = `Abandonada por você | |
| Tenho tentado te esquecer | |
| No fim da tarde, uma paixão | |
| No fim da noite, uma ilusão | |
| No fim de tudo, a solidão | |
| Apaixonada por você | |
| Tenho tentado não sofrer | |
| Lendo antigas poesias | |
| Rindo em novas companhias | |
| E chorando por você |