This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static DateTime dt1970 = new DateTime(1970, 1, 1); | |
private static Random rnd = new Random(); | |
private static readonly int __staticMachine = ((0x00ffffff & Environment.MachineName.GetHashCode()) + | |
#if NETSTANDARD1_5 || NETSTANDARD1_6 | |
1 | |
#else | |
AppDomain.CurrentDomain.Id | |
#endif | |
) & 0x00ffffff; | |
private static readonly int __staticPid = Process.GetCurrentProcess().Id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string typeName = typeof(IEntityTypeConfiguration<>).Name; | |
var assembly = Assembly.GetExecutingAssembly(); | |
assembly.GetTypes() | |
.Where(w => w.GetTypeInfo().ImplementedInterfaces.Any(a => a.Name == typeName)) | |
.ToList() | |
.ForEach(item => | |
{ | |
dynamic instance = item.FullName; | |
builder.ApplyConfiguration(assembly.CreateInstance(instance)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Runtime.Serialization; | |
using System.Runtime.Serialization.Formatters.Binary; | |
namespace Abp.Extensions | |
{ | |
public static class ObjectExtensions | |
{ | |
public static T Dereference<T>(this object obj) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Reflection; | |
using Abp.Application.Services.Dto; | |
namespace Abp.Extensions | |
{ | |
public static class EnumExtensions | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$DotNETCoreUpdatesPath = "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Updates\.NET Core" | |
$DotNetCoreItems = Get-Item -ErrorAction Stop -Path $DotNETCoreUpdatesPath | |
$NotInstalled = $True | |
$DotNetCoreItems.GetSubKeyNames() | Where { $_ -Match "Microsoft .NET Core.*Windows Server Hosting" } | ForEach-Object { | |
$NotInstalled = $False | |
Write-Host "The host has installed $_" | |
} | |
If ($NotInstalled) { | |
Write-Host "Can not find ASP.NET Core installed on the host" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace XCode.Common | |
{ | |
#region 算法1 | |
///// <summary> | |
///// 动态生产有规律的ID | |
///// </summary> | |
//public class Snowflake |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
@rem throw this file in jetbrains installation folder, it takes the last created PyCharm folder (the latest ide update) for the script | |
FOR /F "delims=" %%i IN ('dir /b /ad-h /t:c /od -filter "PyCharm*"') DO SET a=%%i | |
SET PyCharmPath=C:\Program Files (x86)\JetBrains\%a%\bin\PyCharm64.exe | |
echo %PyCharmPath% | |
echo Adding file entries |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
class TimeoutError(Exception): | |
def __init__(self, msg, code=1): | |
self.msg = msg | |
self.code = code | |
def __str__(self): | |
return 'TimeoutError: %s (code %d)' % (self.msg, self.code) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Retrying: | |
def __init__(self, interval=1.0, delay=0.05, maxAttempts=None): | |
self.interval = interval | |
self.delay = delay | |
self.maxAttempts = maxAttempts | |
def __iter__(self): | |
class Iterator: | |
def __init__(self, interval, delay, maxAttempts): | |
self.attempt = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ng-select-highlight: #9aabff; | |
@ng-select-primary-text: #495057; | |
@ng-select-disabled-text: #f9f9f9; | |
@ng-select-border: #e2e5ec; | |
@ng-select-border-radius: 4px; | |
@ng-select-bg: #ffffff; | |
@ng-select-selected: #f3f6f9; | |
@ng-select-marked: #f3f6f9; | |
@ng-select-placeholder: lighten(@ng-select-primary-text, 40); | |
@ng-select-height: calc(1.5em + 1.3rem + 2px); |