Skip to content

Instantly share code, notes, and snippets.

View JerryNixon's full-sized avatar
🤔
Trying to make a living.

Jerry Nixon JerryNixon

🤔
Trying to make a living.
View GitHub Profile
@JerryNixon
JerryNixon / Abbyy.UWP.cs
Created June 12, 2020 23:03
Calling OCRSDK by Abbyy from UWP. This is how you do it.
// create http cache
if (_cachedClient is null)
{
// create credntial for http client
var credentials = new Windows.Security.Credentials.PasswordCredential
{
UserName = _settingsService.AbbyyApplicationId,
Password = _settingsService.AbbyyPassword,
};
var handler = new HttpBaseProtocolFilter { ServerCredential = credentials, };
@JerryNixon
JerryNixon / HorizontallyParition.sql
Last active July 18, 2020 07:43
Horizontal Partitioning SQL Server Tables
CREATE TABLE users
(
Name varchar(10),
Year varchar(4),
)
GO
INSERT INTO users VALUES
('Jerry', '2020')
,('Joe', '2021')
@JerryNixon
JerryNixon / Excel.Reader.cs
Last active April 29, 2021 06:30
Read an Excel File in UWP/WinRT
using Client.Excel.Models;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Windows.Storage;
@JerryNixon
JerryNixon / SettingsHelper.cs
Last active May 15, 2020 00:07
UWP Settings Helper
using Newtonsoft.Json;
using System;
using Windows.Foundation.Collections;
namespace Client.Helpers
{
public class SettingsHelper
{
private readonly IPropertySet _settings;
@JerryNixon
JerryNixon / HttpRequestExtensions.cs
Created February 11, 2020 01:32
This is handy when writing .NET functions in Azure.
public static class HttpRequestExtensions
{
public static bool TryGetBody<T>(this HttpRequest req, out T value, out Exception exception)
{
if (!req.TryGetBody(out var bytes, out exception))
{
value = default;
return false;
}
using System;
namespace Adventure
{
public static class Art
{
public static void DrawDoor(int count = 1, ConsoleColor foreground = ConsoleColor.Cyan, ConsoleColor background = ConsoleColor.Black)
{
WriteLine(" __________ ", count, foreground, background);
WriteLine(" | __ __ | ", count, foreground, background);
using System;
using System.Linq;
namespace Adventure
{
internal class Program
{
private static Game _game;
private static void Main(string[] args)
using System;
using System.Linq;
namespace Adventure
{
internal class Program
{
private static Game _game;
private static void Main(string[] args)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
namespace SnakePrep
{
internal class Program
{
using System;
using System.Drawing;
namespace SnakePrep
{
internal class Program
{
private static ConsoleKey _direction = ConsoleKey.Escape;
private static bool _gameOver = false;
private static Point _current;