Skip to content

Instantly share code, notes, and snippets.

View ahmadaghazadeh's full-sized avatar
🏢
Working from Office

Ahmad Aghazadeh ahmadaghazadeh

🏢
Working from Office
View GitHub Profile
@ahmadaghazadeh
ahmadaghazadeh / LogstashAndroid.java
Created December 22, 2021 09:35 — forked from PatrykGala/LogstashAndroid.java
Add logstash logging for Android App
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
//Logging
LoggerFactory.getLogger(MainActivity.class).warn("Hello");
//Add optional fields in onCreate method (in Activity or Application):
MDC.put("version_android", Build.VERSION.RELEASE);
@ahmadaghazadeh
ahmadaghazadeh / Clean code.md
Created April 7, 2020 10:27 — forked from bansalankit92/Clean code.md
Lessons learnt from “The Clean Code” — Robert C. Martin

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.
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"
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
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');
@ahmadaghazadeh
ahmadaghazadeh / ImageGallery.cshtml
Created October 10, 2016 04:22
MVC image gallery
@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>
}
adb shell input text 'This text'
gradlew -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8580