Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Ahmad Aghazadeh ahmadaghazadeh

🏠
Working from home
View GitHub Profile
@ahmadaghazadeh
ahmadaghazadeh / Clean code.md
Created Apr 7, 2020 — forked from bansalankit92/Clean code.md
Lessons learnt from “The Clean Code” — Robert C. Martin
View Clean code.md

Even bad code can function. But if code isn't clean, it can bring a development organization to its knees.

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.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.
View Dotnet Ef init
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
dotnet ef dbcontext scaffold "Data Source=.;Database=learna;ID=sa;Password=123;" Microsoft.EntityFrameworkCore.SqlServer -d -o Model -c "LearnaContext"
View InsertUpdateDelete
ALTER PROCEDURE [dbo].[sp_Car_Insert]
@RunDate BIGINT ,
@CarNo NVARCHAR(50) ,
@Volume INT ,
@Weight SMALLINT ,
@CarName NVARCHAR(50) ,
@InUse BIT ,
@UserID INT = NULL ,
@CarID TINYINT OUTPUT
View start_wizard.js
var Q = require('q');
var chalk = require('chalk');
var http = require('http');
var connect = require('connect');
var serveStatic = require('serve-static');
var finalhandler = require('finalhandler');
var request = require('request');
var spawn = require('cross-spawn');
var path = require('path');
var fs = require('fs');
View ImageGallery.cshtml
@foreach (var item in resPacks)
{
<div class="col-lg-2 col-md-2 col-sm-3 col-xs-6" width="150" height="150">
@item.NAME
@Html.Image(item._id.ToString(), item.DATA, $"class=\"img-responsive\" alt=\"{item._id.ToString()}\" ")
</div>
}
View Gradlew proxy sync
gradlew -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8580