Skip to content

Instantly share code, notes, and snippets.

View HeathHopkins's full-sized avatar

Heath Hopkins HeathHopkins

View GitHub Profile
@HeathHopkins
HeathHopkins / deploy.pubxml
Created November 8, 2016 19:56
asp.net core web deploy
<MSDeployPublishMethod>RemoteAgent</MSDeployPublishMethod>
<AuthType>NTLM</AuthType>
@HeathHopkins
HeathHopkins / Remove-AllPackages.ps1
Created October 15, 2016 14:56
Remove All NuGetPackages
Get-Package | Uninstall-Package -RemoveDependencies
#r "Newtonsoft.Json"
#r "System.Configuration"
#r "Microsoft.IdentityModel.Clients.ActiveDirectory.dll"
using System.Net;
using System.Configuration;
using System.Security.Claims;
using System.Net.Http.Headers;
using Newtonsoft.Json;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
@HeathHopkins
HeathHopkins / ParentViewController.Keyboard.cs
Created April 24, 2016 16:20 — forked from redent/ParentViewController.Keyboard.cs
Parent view controller to handle keyboard notifications to center views in the screen. UIScrollView related methods moved to an extension class.
using System;
using Foundation;
using UIKit;
using TwinCoders.TouchUtils.Extensions;
using CoreGraphics;
namespace SalesForce.Touch.Views
{
public abstract partial class ParentViewController
{
public const int KEY_SIZE = 16;
public byte[] Encrypt (string password, string input)
{
var sha256CryptoServiceProvider = new SHA256CryptoServiceProvider();
var hash = sha256CryptoServiceProvider.ComputeHash(Encoding.UTF8.GetBytes(password));
var key = new byte[KEY_SIZE];
var iv = new byte[KEY_SIZE];
Buffer.BlockCopy(hash, 0, key, 0, KEY_SIZE);
@HeathHopkins
HeathHopkins / fa-checkbox.css
Last active August 29, 2015 14:23
Font Awesome Checkbox
input[type=checkbox] { display:none; }
input[type=checkbox] + label:before {
font-family: FontAwesome;
display: inline-block;
content: "\f096";
letter-spacing: 10px;
}
input[type=checkbox]:checked + label:before {
content: "\f046";
letter-spacing: 5px;
public override void OnActivated (UIApplication application)
{
//When your app is backgrounded, iOS takes a snapshot.
//When the app comes back from the background it shows this snapshot at launch until your app is ready
//Sometimes apple forgets to remove the splash screen.
//Your app is in the forground and working. To prove it you can rotate, and see half your real screen.
//To prevent this from happening you can manually remove the view
foreach (var w in application.Windows) {
if (w != null && w != window) {
@HeathHopkins
HeathHopkins / ExtensionMethods.cs
Last active April 27, 2022 13:33
Xamarin.iOS Extension Methods
using System;
using MonoTouch.UIKit;
namespace System
{
public static class ExtensionMethods
{
public static UIColor ToUIColor(this string hexString)
{
hexString = hexString.Replace("#", "");
@HeathHopkins
HeathHopkins / AssemblyVersion.cs
Created January 6, 2014 19:59
Build date of current application. Must have wildcard in AssemblyVersion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using TestLibrary;
namespace AssemblyDateTest
{
/*
* L.TileLayer is used for standard xyz-numbered tile layers.
*/
L.Google = L.Class.extend({
includes: L.Mixin.Events,
options: {
minZoom: 0,
maxZoom: 18,
tileSize: 256,