This file contains 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
param ([string]$excelFileName) | |
Set-ExecutionPolicy Bypass -Scope Process | |
[System.Threading.Thread]::CurrentThread.CurrentCulture = New-Object "System.Globalization.CultureInfo" "en-US" | |
Function ExportWSToCSV ($excelPath, $csvFileName) | |
{ | |
$excelFile = Get-Item $excelPath | |
$excelLocation = $excelFile.DirectoryName | |
$E = New-Object -ComObject Excel.Application |
This file contains 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 ObjectExtensions | |
{ | |
private static readonly ConcurrentDictionary<Type, Func<object, object>> MemberwiseCloneCache = | |
new ConcurrentDictionary<Type, Func<object, object>>(); | |
public static T With<T>(this T obj, Action<T> mutator) where T : class | |
{ | |
if (obj == null) | |
{ | |
return null; |
This file contains 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
#!/bin/bash | |
env=prod | |
app_repo= | |
app_name= | |
rm -r code/ | |
git clone ${app_repo} code | |
cd code | |
mix deps.get --only ${env} |
This file contains 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
namespace System.Web.Mvc | |
{ | |
using Linq.Expressions; | |
public static class ModelStateDictionaryExtensions | |
{ | |
public static void AddModelError<TEntity, TValue>(this ModelStateDictionary modelState, TEntity model, Expression<Func<TEntity, TValue>> member, string value) | |
{ | |
var memberPath = ExpressionHelper.GetExpressionText(member); | |
modelState.AddModelError(memberPath, value); |
This file contains 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
<Target Name="BeforeBuild" DependsOnTargets="CreateVersionInfo"> | |
<TransformXml Source="web.base.config" Transform="web.orig.$(Configuration).config" Destination="web.config" /> | |
</Target> |
This file contains 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
namespace System.IO | |
{ | |
public static class StreamExtensions | |
{ | |
public static byte[] ToByteArray(this Stream inputStream) | |
{ | |
using (var memoryStream = new MemoryStream()) | |
{ | |
inputStream.Position = 0; | |
inputStream.CopyTo(memoryStream); |
This file contains 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
<input | |
data-val="true" | |
data-val-extension="Wrong extension" | |
data-val-extension-list="jpg|jpeg" | |
type="file" | |
/> | |
// Add reference to additional-methods.js from http://jqueryvalidation.org | |
// Add at the end of the jquery.validate.unobtrusive.js |
This file contains 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
<system.web> | |
<customErrors | |
mode="RemoteOnly" | |
// ResponseRewrite would be a better way, but is uses Server.Transfer so we have to use | |
// ResponseRedirect which redirects whole page. To do this better you have to wrap 404 errors | |
// in Application_Error | |
redirectMode="ResponseRedirect" | |
defaultRedirect="Error"> |
This file contains 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 (var context = new DatabaseContext()) | |
{ | |
context.Configuration.ValidateOnSaveEnabled = false; | |
// create product with existing ID | |
var product = new Product | |
{ | |
Id = 928 | |
}; | |
This file contains 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
DiskPart | |
List Disk | |
Select Disk # | |
Clean | |
Create Partition Primary | |
Select Partition 1 | |
Active | |
Format fs=FAT32 quick | |
Assign |
NewerOlder