202025452
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| char* intToAscii(int num) { | |
| // Handle special case for zero | |
| if (num == 0) { | |
| char* str = malloc(2); // Allocate space for "0" and null terminator | |
| if (str == NULL) { | |
| return NULL; // Allocation failed | |
| } |
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
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #define SIZE 4 | |
| // Function to parse input constraints | |
| int parse_constraints(char *input, int constraints[16]) | |
| { | |
| int i; | |
| int j; |
I hereby claim:
- I am danmarz on github.
- I am danmarius (https://keybase.io/danmarius) on keybase.
- I have a public key whose fingerprint is ACC2 2FC9 16B2 C732 5247 075F 69A3 CF12 5FBE 00C7
To claim this, I am signing this object:
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
| #!/bin/sh | |
| # Generates a self-signed certificate. | |
| # Edit dovecot-openssl.cnf before running this. | |
| umask 077 | |
| OPENSSL=${OPENSSL-openssl} | |
| SSLDIR=${SSLDIR-/etc/ssl} | |
| OPENSSLCONFIG=${OPENSSLCONFIG-dovecot-openssl.cnf} |
function fibonacci(n) {
if (n <= 1) {
return 1
}
return fibonacci(n - 1) + fibonacci(n - 2);
}
function memoizedFibonacci(n, memo) {We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate the Angular change log.
Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:
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
| import { | |
| Controller, | |
| Get, | |
| ParseIntPipe, | |
| Query, | |
| } from '@nestjs/common'; | |
| export class GalleryController { | |
| constructor() { | |
| } |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
NewerOlder