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
// Created by inigo quilez - iq/2013 | |
// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. | |
// Volumetric clouds. It performs level of detail (LOD) for faster rendering | |
float noise( in vec3 x ) | |
{ | |
vec3 p = floor(x); | |
vec3 f = fract(x); | |
f = f*f*(3.0-2.0*f); |
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
# Login to Azure PowerShell | |
Login-AzureRmAccount | |
# Create the self signed cert | |
$currentDate = Get-Date | |
$endDate = $currentDate.AddYears(1) | |
$notAfter = $endDate.AddYears(1) | |
$pwd = "P@ssW0rd1" | |
$thumb = (New-SelfSignedCertificate -CertStoreLocation cert:\localmachine\my -DnsName com.foo.bar -KeyExportPolicy Exportable -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" -NotAfter $notAfter).Thumbprint | |
$pwd = ConvertTo-SecureString -String $pwd -Force -AsPlainText |
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
public class DbEntityExceptionProvider<TEntity> where TEntity: class, IBaseTableEntity | |
{ | |
public IEnumerable<DbEntityValidationMessage> TryToUnpackDatabaseException(Exception ex) | |
{ | |
var response = new List<DbEntityValidationMessage>(); | |
var dbException = ex as DbEntityValidationException; | |
if (dbException != null) | |
{ |
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
public class TypeChangesEnumerator<TEntity> | |
{ | |
public IEnumerable<ObjectPropertyChange> EnumeratePropertyDifferences(TEntity oldObject, TEntity newObject) | |
{ | |
var properties = typeof(TEntity).GetProperties(); | |
var changes = new List<ObjectPropertyChange>(); | |
foreach (PropertyInfo pi in properties) | |
{ | |
var value1 = typeof(TEntity).GetProperty(pi.Name).GetValue(oldObject, null); |
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
public static IEnumerable<int> GetEnumValuesWithAttribute<T>(Type enumType) where T : Attribute | |
{ | |
var valuesWithAttribute = new List<int>(); | |
var typeOfAttribute = typeof(T); | |
foreach (var value in Enum.GetValues(enumType)) | |
{ | |
var fieldInfo = enumType.GetField(value.ToString()); | |
if (fieldInfo.CustomAttributes.Any(a => a.AttributeType == typeOfAttribute)) | |
{ |
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
public static class AssemblyHelpers | |
{ | |
public static IEnumerable<Type> GetTypesWithAttribute<TAttr>(Assembly assembly) where TAttr : Attribute | |
{ | |
foreach (Type type in assembly.GetTypes()) | |
{ | |
if (type.GetCustomAttributes(typeof(TAttr), true).Length > 0) | |
{ | |
yield return type; | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Semantic</title> | |
<link href="lib/semantic.css" rel="stylesheet" /> | |
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" | |
crossorigin="anonymous"></script> | |
<script src="lib/semantic.js" type="text/javascript"></script> | |
</head> |