Skip to content

Instantly share code, notes, and snippets.

View fraxedas's full-sized avatar
😀
Working from Home in my dream job

Oscar Fraxedas fraxedas

😀
Working from Home in my dream job
View GitHub Profile
"C:\Program Files (x86)\NUnit 2.6.3\bin\nunit-console.exe" /include:Firehose /result:console-test.xml /work:results C:\Users\fraxedas\Documents\GitHub\photo\src\photo.exif.unit.test\bin\Debug\photo.exif.unit.test.dll
@fraxedas
fraxedas / Ocr.cs
Last active November 27, 2018 12:09
OCR with Azure Computer Vision
public static async Task<string> GetTextAsync(Stream image)
{
try
{
using (var client = new ComputerVisionClient(
new ApiKeyServiceClientCredentials(SubscriptionKey))
{Endpoint = UriBase}
)
{
var result =
@fraxedas
fraxedas / ClassGenerator.sql
Created January 24, 2019 16:41 — forked from ernado-x/ClassGenerator.sql
Generate C# class from database table
--from SO: http://stackoverflow.com/questions/5873170/generate-class-from-database-table
declare @TableName sysname = 'TableName'
declare @Result varchar(max) = 'public class ' + @TableName + '
{'
select @Result = @Result + '
public ' + ColumnType + NullableSign + ' ' + ColumnName + ' { get; set; }
'
from
@fraxedas
fraxedas / Assert.cs
Last active April 22, 2023 21:02
Poor's man test framework.
public class Assert{
public static void AreEquals(int[] first, int[] second) {
// Compare
var equals = first.SequenceEqual(second);
// String representation
var firstText = $"[{string.Join(",", first)}]";
var secondText = $"[{string.Join(",", second)}]";
// Write the output to the console
if(equals){