This file contains 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
if ($_SERVER['HTTPS'] != "on") { | |
$url = "https://". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; | |
header("Location: $url"); | |
exit; | |
} |
This file contains 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
netsh wlan set hostednetwork mode=allow ssid=NetworkName key=Password | |
netsh wlan start hostednetwork |
This file contains 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 System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Data; | |
namespace OwensWpfFunStuff | |
{ | |
public class DataGridBoundTemplateColumn : DataGridBoundColumn | |
{ | |
public DataTemplate CellTemplate { get; set; } | |
public DataTemplate CellEditingTemplate { get; set; } |
This file contains 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 EnumToItemsSourceConverter : IValueConverter | |
{ | |
public EnumToItemsSourceConverter() : base() { } | |
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) | |
{ | |
if (value == null || !(value is Enum)) | |
{ | |
return new object[] { }; |
This file contains 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 System; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
namespace DataStructures | |
{ | |
public class AsyncGeneratorCache<TKey, TValue> | |
{ | |
private Func<TKey, Task<TValue>> _generate; | |
private Dictionary<TKey, Task<TValue>> _promises = new Dictionary<TKey, Task<TValue>>(); |
This file contains 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 System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Runtime.CompilerServices; | |
namespace ViewModelBase | |
{ | |
/// <summary> |
This file contains 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 System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Controls.Primitives; |
This file contains 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\s([\w?]*)\s(\w*)\s{ get; set; } | |
[DisplayName("$2")]\r\n\t\tpublic $1 $2 { get; set; } |
This file contains 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
// Stole this from http://devcenter.wintellect.com/jprosise/handling-the-back-button-in-windows-10-uwp-apps | |
sealed partial class App : Application | |
{ | |
public App() | |
{ | |
this.InitializeComponent(); | |
this.Suspending += OnSuspending; | |
} |
This file contains 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
//From Model Builder | |
modelBuilder.Entity<ThisTable>(). | |
HasMany(c => c.OtherTable). | |
WithMany(p => p.AssocTable). | |
Map( | |
m => | |
{ | |
m.MapLeftKey("ThisId"); | |
m.MapRightKey("OtherId"); | |
m.ToTable("AssocTable"); |
OlderNewer