Using Uni2Me
- It's free but discontinued.
Using UTFCast
- Proprietary software
- Allows conversion from ANSI to UTF-8 with or without BOM
| import { FormGroup, ValidationErrors } from '@angular/forms'; | |
| export function getFormValidationErrors(form: FormGroup) { | |
| const result = []; | |
| Object.keys(form.controls).forEach(key => { | |
| const controlErrors: ValidationErrors = form.get(key).errors; | |
| if (controlErrors) { | |
| Object.keys(controlErrors).forEach(keyError => { |
| import { NamingStrategyInterface, DefaultNamingStrategy } from 'typeorm' | |
| import { snakeCase } from 'typeorm/util/StringUtils' | |
| export class SnakeNamingStrategy extends DefaultNamingStrategy implements NamingStrategyInterface { | |
| tableName(className: string, customName: string): string { | |
| return customName ? customName : snakeCase(className) | |
| } | |
| columnName(propertyName: string, customName: string, embeddedPrefixes: string[]): string { | |
| return snakeCase(embeddedPrefixes.join('_')) + (customName ? customName : snakeCase(propertyName)) |
| <?php | |
| // This can be found in the Symfony\Component\HttpFoundation\Response class | |
| const HTTP_CONTINUE = 100; | |
| const HTTP_SWITCHING_PROTOCOLS = 101; | |
| const HTTP_PROCESSING = 102; // RFC2518 | |
| const HTTP_OK = 200; | |
| const HTTP_CREATED = 201; | |
| const HTTP_ACCEPTED = 202; |
| sudo apachectl stop | |
| sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null |
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.
| var month= ["January","February","March","April","May","June","July", | |
| "August","September","October","November","December"]; | |
| var month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul","Aug", "Sep", "Oct", "Nov", "Dec"]; | |
| //used with date.getMonth() |