Skip to content

Instantly share code, notes, and snippets.

View cilerler's full-sized avatar
:octocat:

Cengiz Ilerler cilerler

:octocat:
View GitHub Profile
@cilerler
cilerler / ci-helpers-date.js
Created November 1, 2012 13:14
ToOADate and FromOADate
var oaDate = new Date(1899, 11, 30);
var millisecondsOfaDay = 24 * 60 * 60 * 1000;
Date.prototype.ToOADate = function() {
var result = (Date.parse(this) - Date.parse(oaDate)) / millisecondsOfaDay;
return result;
};
Number.prototype.FromOADate = function() {
var result = new Date();

Keybase proof

I hereby claim:

  • I am cilerler on github.
  • I am cilerler (https://keybase.io/cilerler) on keybase.
  • I have a public key ASAly_hLH1FVQk7kT73AiWSR_w6Ue5Z7qdSasLKD84pjQQo

To claim this, I am signing this object:

@echo off
REM download latest nodejs & npm from https://nodejs.org/en/
REM or RUN command below in administrative mode
REM CALL npm-windows-upgrade
CALL npm uninstall -g @angular/cli
CALL npm uninstall -g generator-ngx-rocket
@echo off
ECHO -=[NODE]=-
CALL node -v
ECHO -=[NPM]=-
CALL npm -v
ECHO -=[YARN]=-
CALL yarn -v
public abstract class BaseEntity
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
//x [Required]
//x [DatabaseGenerated(DatabaseGeneratedOption.Computed)]
//!++ Do not uncomment below https://github.com/OData/RESTier/issues/491
//x [Timestamp] //ROWVERSION
//x public byte[] UpdateVersion { get; set; }
@cilerler
cilerler / 189607_v1.sql
Last active October 30, 2017 20:07
Delete millions of rows from a SQL table https://dba.stackexchange.com/questions/189607
PRINT 'Drop temporary table if exist';
IF OBJECT_ID('tempdb..#MyTempTable') IS NOT NULL
BEGIN
DROP TABLE #MyTempTable;
END;
GO
CREATE TABLE #MyTempTable
(
Id BIGINT,
const _ = require('lodash');
const input = [{
"ActiveMembers": [{
"Id": 101,
"Name": "alpha"
}, {
"Id": 102,
"Name": "bravo"
}],
sequenceDiagram
    participant Service
    participant Provider

    loop Minute query
        Service->> Provider: request Records

        alt is maintenance
 Provider --x Service: response No-Record
@cilerler
cilerler / LoggerExtensionsHelper.cs
Last active November 17, 2016 12:50
Extended LogDebug and LogTrace with Conditional attribute
public static class LoggerExtensionsHelper
{
public const string Debug = "DEBUG";
public const string Trace = "TRACE";
/// <summary>Formats and writes a debug log message.</summary>
/// <param name="logger">The <see cref="T:Microsoft.Extensions.Logging.ILogger" /> to write to.</param>
/// <param name="eventId">The event id associated with the log.</param>
/// <param name="exception">The exception to log.</param>
/// <param name="message">Format string of the log message.</param>
public class UsingDisplayAttributeOnEnum
{
private void Main()
{
IEnumerable<SelectListItem> result = typeof (Genre).GetItems();
}
}
public enum Genre
{