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
| const express = require('express'); | |
| const { createProxyMiddleware } = require('http-proxy-middleware'); | |
| const cors = require('cors'); | |
| const cookieParser = require('cookie-parser'); | |
| const session = require('express-session'); | |
| const path = require('path'); | |
| const app = express(); | |
| const PORT = process.env.PORT || 3000; |
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 FoodViewModel | |
| { | |
| public string FavouriteFood { get; set; } | |
| } | |
| public ActionResult UpdateFood(FoodViewModel viewModel) | |
| { | |
| if(ModelState.IsValid) | |
| { | |
| UpdateStats(viewModel.FavouriteFood); |
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
| Test 'Testy' failed: System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation. | |
| ---- System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation. | |
| -------- System.InvalidCastException : Unable to cast object of type 'Ploeh.AutoFixture.Kernel.OmitSpecimen' to type 'Language'. | |
| at System.RuntimeMethodHandle._InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct& signature, RuntimeType declaringType) | |
| at System.RuntimeMethodHandle.InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct signature, RuntimeType declaringType) | |
| at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) | |
| at Ploeh.AutoFixture.Kernel.ConstructorMethod.Invoke(IEnumerable`1 parameters) | |
| at Ploeh.AutoFixture.Kernel.MethodInvoker.Create(Object request, ISpecimenContext context) | |
| at Ploeh.AutoFixture.Kernel.FilteringSpecimenBuilder.Create(Ob |
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
| var fileList = EnumerateDirectory(@"C:\example\directory", "*.*", SearchOption.AllDirectories); | |
| ventilator.Run(fileList); | |
| var result = sink.Run(fileList.Length); | |
| Console.WriteLine("Found the length of {0} files in {1} milliseconds.\nDirectory size is {2}", | |
| fileList.Length, stopWatch.ElapsedMilliseconds, result); |
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 (var context = new Context(1)) | |
| using (var client = context.Socket(SocketType.REQ)) | |
| { | |
| client.Connect("tcp://localhost:5555"); | |
| var time = client.Send("", Encoding.Unicode); | |
| Console.WriteLine(time); | |
| } |
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
| git status --porcelain | select-string -pattern "\.dll|\.xml" | foreach-object { $_ -replace "\?\? "} | rm |
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
| sql-baseline -s:.\SqlExpress -d:AdventureWorks -o:..\Src\AdventureWeb\AdventureWeb.Database\db |
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
| SELECT s.name [Schema], t.name [Table], | |
| CAST(Value AS nvarchar(500)) AS [MS_Description] | |
| FROM sys.extended_properties AS ep | |
| JOIN sys.tables t | |
| on ep.major_id = t.object_id | |
| join sys.schemas s | |
| on s.schema_id = t.schema_id | |
| WHERE ep.name = N'MS_Description' AND ep.minor_id = 0 | |
| and LOWER(CAST(Value AS nvarchar(500))) like '%lookup%' | |
| order by s.name, t.name |
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 void RunValidation() | |
| { | |
| foreach (var propertyInfo in GetType().GetProperties()) | |
| { | |
| var attribute = Attribute.GetCustomAttribute(propertyInfo, typeof(RequiredField)) as RequiredField; | |
| if (attribute == null) continue; | |
| /* | |
| if (propertyInfo.PropertyType == typeof(string) | |
| && string.IsNullOrEmpty((string)propertyInfo.GetValue(this, 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 void AssemblyLoad_tests() | |
| { | |
| // Display information about the EXE assembly. | |
| var a = Assembly.GetExecutingAssembly(); | |
| Console.WriteLine("Assembly identity = {0}", a.FullName); | |
| Console.WriteLine("\tLocation = {0}\n", a.Location); | |
| // Display the set of assemblies our assemblies reference. | |
| Console.WriteLine("Referenced assemblies:"); | |
| foreach (var an in a.GetReferencedAssemblies()) |
NewerOlder