Skip to content

Instantly share code, notes, and snippets.

@DorukUlucay
DorukUlucay / page.html
Last active November 19, 2020 16:42
html templates
<html>
<head>
<!-- <title></title> -->
<!-- <script src=""></script> -->
<!-- <style></style> -->
<!-- <link rel="stylesheet" type="text/css" href=""> -->
</head>
<body>
void Logit(int step, object ob, string location)
{
if (string.IsNullOrWhiteSpace(location))
location = $"Debug Session {DateTime.Now.Date.ToString("yyyyMMdd")}";
Log.Fatal($"{location}: {step}, {Newtonsoft.Json.JsonConvert.SerializeObject(ob)}");
}
@DorukUlucay
DorukUlucay / arch.md
Last active December 27, 2022 19:21
sw dictionary

Micro frontends

  • Source: InfoQ

Micro frontends are intended to bring the same benefits of microservices to the UI layer. By breaking up a complex system into smaller, more manageable pieces,teams can rapidly develop and release new features and functionality.

@DorukUlucay
DorukUlucay / Parsing.md
Last active April 20, 2020 07:01
tips & tricks

Parsing Strings into Numbers with the NumberStyles Enumeration

// throws System.FormatException
var number = int.Parse(" 1,000 ");

// parses into 1000
var number = int.Parse(" 1,000 ", System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.AllowLeadingWhite | System.Globalization.NumberStyles.AllowTrailingWhite);

source: https://codewithshadman.com/csharp-number-and-datetime-tips

@DorukUlucay
DorukUlucay / 000.md
Created March 8, 2020 20:26
Golang notes

go lang notes

//https://stackoverflow.com/a/290265/1397858
private static readonly DateTime Jan1st1970 = new DateTime
(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
public static long CurrentTimeMillis()
{
return (long) (DateTime.UtcNow - Jan1st1970).TotalMilliseconds;
}
@DorukUlucay
DorukUlucay / cloudSettings
Last active February 28, 2020 11:13
my vs code configuration automatically synced by *Settings Sync* extension
{"lastUpload":"2020-02-28T11:13:17.567Z","extensionVersion":"v3.4.3"}
for($i=1; $i -le 5; $i++) { mkdir "TEMP$i" }
@DorukUlucay
DorukUlucay / r.ps1
Created July 9, 2019 11:18
sequental rename in a dir
$i = 1
Get-ChildItem *.sql | %{Rename-Item $_ -NewName ('SomeFileName_{0:D2}.sql' -f $i++)}
@DorukUlucay
DorukUlucay / razor.md
Created June 25, 2019 14:25
Razor Code Snippets

Razor DropDownListFor

@Html.DropDownListFor(model => model.StuffId, new SelectList(ViewBag.StuffList, "Value", "Text"), "Please Select", new { required = "required" })

Razor TextBoxFor

@Html.TextBoxFor(x => x.SomeStuff, "", new { @class = "form-control", placeholder = "Type in some stuff here" })