Skip to content

Instantly share code, notes, and snippets.

View rasoulian's full-sized avatar
😎
Focusing

Ali Rasoulian rasoulian

😎
Focusing
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace UtilitiesLibrary.Networking
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
namespace Sample15
{
class Program
{
static async Task Main(string[] args)
public static DateTime GetLinkerTime(this Assembly assembly, TimeZoneInfo target = null)
{
var filePath = assembly.Location;
const int c_PeHeaderOffset = 60;
const int c_LinkerTimestampOffset = 8;
var buffer = new byte[2048];
using (var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
stream.Read(buffer, 0, 2048);
@rasoulian
rasoulian / table-partitioning.sql
Last active August 5, 2019 12:23
sql-table-partioning
ALTER DATABASE [ConfigurationDb_Staging]
ADD FILEGROUP January
GO
ALTER DATABASE [ConfigurationDb_Staging]
ADD FILEGROUP February
GO
ALTER DATABASE [ConfigurationDb_Staging]
ADD FILEGROUP March
GO
ALTER DATABASE [ConfigurationDb_Staging]
@rasoulian
rasoulian / cloudSettings
Last active September 9, 2019 13:13
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-06-28T20:44:45.678Z","extensionVersion":"v3.3.1"}
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore;
namespace drkarami
{
@rasoulian
rasoulian / ngrxintro.md
Created August 19, 2018 08:58 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

public class CreateTableDto
{
[Required]
[StringLength(50)]
public string Name { get; set; }
[StringLength(200)]
public string Description { get; set; }
[Required]
@rasoulian
rasoulian / Program.cs
Created July 2, 2018 09:59
ReactiveScheduler
namespace Scheduler
{
class Program
{
static void Main(string[] args)
{
Scheduling.ScheduleWithEnd();
Scheduling.ScheduleWithoutEnd();
Console.ReadKey();
@rasoulian
rasoulian / ShortGuid.cs
Created October 5, 2016 08:35
A shorter and url friendly GUID class in C#
using System;
namespace CSharpVitamins
{
/// <summary>
/// Represents a globally unique identifier (GUID) with a
/// shorter string value. Sguid
/// </summary>
public struct ShortGuid
{