Bad idea to leave “console.log()” calls in your production JavaScript code?

It will cause Javascript errors, terminating the execution of the block of Javascript containing the error. You could, however, define a dummy function that’s a no-op when Firebug is not active: if(typeof console === “undefined”) { console = { log: function() { } }; } If you use any methods other than log, you would … Read more

What’s the risk of deploying debug symbols (pdb file) in a production environment?

Here is another question to look at: Are there any security issues leaving the PDB debug files on the live servers? And more info on PDB files: PDB Files: What Every Developer Must Know In general, I always include pdb files in my deployments, the gains are too huge to ignore. If you never expose … Read more

Git production/staging server workflow

It’s better to use master branch only for Production and development branch for Staging. Each developer should create local branch to add new features and then merge with development branch. If you’re new to a git, try to use – http://github.com/nvie/gitflow There is also good picture describing git branching model – http://nvie.com/posts/a-successful-git-branching-model/

Create an index on a huge MySQL production table without table locking

[2017] Update: MySQL 5.6 has support for online index updates https://dev.mysql.com/doc/refman/8.0/en/innodb-online-ddl-operations.html#online-ddl-index-syntax-notes In MySQL 5.6 and higher, the table remains available for read and write operations while the index is being created or dropped. The CREATE INDEX or DROP INDEX statement only finishes after all transactions that are accessing the table are completed, so that the … Read more

How to check if Angular application running in Production or Development mode

You can use this function isDevMode import { isDevMode } from ‘@angular/core’; … export class AppComponent { constructor() { console.log(isDevMode()); } } One note: be carefull with this function if(isDevMode()) { enableProdMode(); } You will get Error: Cannot enable prod mode after platform setup https://github.com/angular/angular/blob/2.0.0/modules/%40angular/core/src/application_ref.ts#L58 Other options environment variable import { environment } from ‘src/environments/environment’; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)