Skip to content

Instantly share code, notes, and snippets.

View sjehutch's full-sized avatar

scott hutchinson sjehutch

View GitHub Profile
@sjehutch
sjehutch / HR1.cs
Last active August 18, 2019 04:21
HackerRank1
using System;
namespace myBlank
{
class Program
{
static void Main(String[] args)
{
int i = 4;
@sjehutch
sjehutch / TestConvert.cs
Created August 17, 2019 16:17
Int Parse vs Convert to int c#
using System;
namespace myBlank
{
class Program
{
static void Main(string[] args)
{
int iterations = 1000000;
@sjehutch
sjehutch / TestFinalPreformance.playground
Created August 16, 2019 13:17
Using Final in swift testing preformance
import Foundation
import XCTest
class MethodAccess: NSObject {
final func finalFunction(x : Int)->Int {
return x + 1
}
func notFinalFunction(x : Int)->Int {
@sjehutch
sjehutch / Comparelist.cs
Created August 8, 2019 22:54
Comparing arrarylist Lists and int array
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
@sjehutch
sjehutch / Sort.cs
Created July 27, 2019 23:33
Sorted Arrary Extention
using System;
public class Sort {
public static int[] SortArray(int[] array)
{
int length = array.Length;
int temp = array[0];
@sjehutch
sjehutch / Hashmap.cs
Created July 14, 2019 20:08
Hashmap C#
using System;
using System.Diagnostics;
namespace consoletest
{
class Program
{
static void Main(string[] args)
{
var watch = new Stopwatch();
using System;
using System.Threading.Tasks;
namespace console1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(Systems.GetEqual("a", "c"));
@sjehutch
sjehutch / Generic.cs
Created July 5, 2019 13:22
Sample Generic T
using System;
namespace console1
{
public class Systems
{
public static bool GetEqual<T>(T a, T b) where T : IComparable<T>
{
return a.CompareTo(b) == 0;
}
}
@sjehutch
sjehutch / Standards.txt
Created April 30, 2019 12:47
Coding Standards
MVVM Cross
Solution Components
For the DL Xamarin projects we will use the MvvmCross framework. This framework acts as a helper to build a cross-platform application using the MVVM pattern. For more information about MvvmCross:
* MvvmCross Overview https://mvvmcross.com/docs/feature-overview
* MvvmCross App Architecture https://mvvmcross.com/docs/app-architecture
* IoC /DI https://mvvmcross.com/docs/inversion-of-control-ioc /
@sjehutch
sjehutch / RemoveCopyPaste.swift
Created April 18, 2019 12:52
Extension to remove copy paste in all UITextFields swift
/// Create Extention
// class TextField: UITextField
extension UITextField {
open override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
return action == #selector(UIResponderStandardEditActions.cut) || action == #selector(UIResponderStandardEditActions.copy)
}
}
// Usage