Skip to content

Instantly share code, notes, and snippets.

View nowsathns's full-sized avatar

Mohamed Nowshath nowsathns

View GitHub Profile
@nowsathns
nowsathns / EFExtensions.cs
Created October 17, 2016 12:15 — forked from ondravondra/EFExtensions.cs
C# extension for executing upsert (MERGE SQL command) in EF with MSSQL
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
namespace EFExtensions
@nowsathns
nowsathns / dlAttachments.py
Created November 2, 2016 07:52 — forked from baali/dlAttachments.py
Python script to download all gmail attachments.
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail
# Make sure you have IMAP enabled in your gmail settings.
# Right now it won't download same file name twice even if their contents are different.
import email
import getpass, imaplib
import os
import sys
detach_dir = '.'
@nowsathns
nowsathns / NgbDateCustomParserFormatter.ts
Created March 21, 2019 07:05
Custom Date Format Parser for the NGBootstrap DatePicker with Moment.js
import { Injectable, Inject } from "@angular/core";
import { NgbDateParserFormatter, NgbDateStruct } from "@ng-bootstrap/ng-bootstrap";
import * as moment from 'moment';
@Injectable()
export class NgbDateCustomParserFormatter extends NgbDateParserFormatter {
private dformat : string;
constructor(@Inject('dateFormat') df: string) {
super();
@nowsathns
nowsathns / log4net.config
Last active September 22, 2019 15:31
Log4Net Configuration for Ado.Net Appender & S3 Appender
<?xml version="1.0"?>
<log4net debug="true">
<root>
<level value="DEBUG" />
<appender-ref ref="AdoNetAppender"/>
<appender-ref ref="S3Appender"/>
</root>
<appender name="S3Appender" type="log4net.Appender.RollingFileS3Appender, log4net.Appender.AWS">
<param name="BucketName" value="logs-jcbapostas" />
<param name="LogDirectory" value="log-diagnostics" />
@nowsathns
nowsathns / CacheRegistration.cs
Last active September 29, 2019 10:27
Redis Cache Manager Class
using Autofac;
using Hangfire;
using StackExchange.Redis;
using StackExchange.Redis.Extensions.Core;
using StackExchange.Redis.Extensions.MsgPack;
using System;
using System.Configuration;
using System.Runtime.Caching;
namespace TestApp02.Utility
{
@nowsathns
nowsathns / readme.md
Last active February 28, 2020 13:40
Temporal Tables
Features CT CDC Temporal
Tracks Data Changes Yes Yes Yes
Tracking mechanism Synchronous Asynchronous Synchronous
Require enabling at Database Level Yes Yes No
Require enabling at Table Level Yes Yes Yes
Historical Data retention No Yes Yes
Ability to Recover data from history No Yes Yes
Requires change in current code Yes Yes No
Table requires primary Key Yes Yes Yes