Skip to content

Instantly share code, notes, and snippets.


Yulong Jing jingyulong

View GitHub Profile
jingyulong / GetTimeStamp.cs
Created Dec 18, 2018
Get TimeStamp in C#
View GetTimeStamp.cs
// Unix time, which is defined as the number of seconds since midnight (UTC) on 1st January 1970.
// The latest version of .Net (v4.6) just added built-in support for Unix time conversions. That includes both to and from Unix time represented by either seconds or milliseconds.
// Unix time in seconds to DateTimeOffset:
// DateTimeOffset dateTimeOffset = DateTimeOffset.FromUnixTimeSeconds(1000);
// DateTimeOffset to Unix time in seconds:
// long unixTimeStampInSeconds = dateTimeOffset.ToUnixTimeSeconds();
// Unix time in milliseconds to DateTimeOffset:
// DateTimeOffset dateTimeOffset = DateTimeOffset.FromUnixTimeMilliseconds(1000000);
// DateTimeOffset to Unix time in milliseconds:
// long unixTimeStampInMilliseconds = dateTimeOffset.ToUnixTimeMilliseconds();
View UniqueLogin.cs
public class OnlineInfo
private static readonly string CurrentSessionId = HttpContext.Current.Session.SessionID;
public static string CurrentUserName { get; set; }
/// <summary>
/// Key:SessionID,Value:UserName
/// </summary>
public static Dictionary<string, string> List
View V2_ReadFile.cs
while (ReadLine != null)
if (condition)
while (ReadLine != null)
if (condition)
View gist:696bd4a4a2c53d65c08482138492e0f5
"editor.formatOnPaste": true,
"editor.formatOnType": false,
"editor.formatOnSave": true,
"prettier.eslintIntegration": true,
"eslint.autoFixOnSave": true,
"eslint.enable": true,
"eslint.validate": [
"language": "html",
jingyulong / VultrDataCentersPingTester.bat
Created Dec 12, 2018
From Local to Vultr DataCenters Ping Tester
View VultrDataCentersPingTester.bat
@echo off
echo ========================================
echo From Local to Vultr DataCenters Ping Tester
echo ========================================
echo 01 Tokyo
ping -n 10
echo =============================