Skip to content

Instantly share code, notes, and snippets.

View mikecole's full-sized avatar

Mike Cole mikecole

View GitHub Profile
@mikecole
mikecole / gist:3b4c81222f0312ee1868848d64e85ccc
Created August 25, 2016 16:12
Chocolatey Community Package Maintainers Update - August 2016
Chocolatey Community Package Maintainers Update - August 2016
Welcome to the inaugural email update for Chocolatey community package maintainers. We need a way to provide important information to the community maintainers, so we created this list. If you are no longer maintaining packages on Chocolatey.org, simply unsubscribe from future emails at the bottom of this list. Also, you can respond directly to the email if you have questions or concerns.
Checksums Required For All Future Package Approvals
tl;dr - Moving forward packages will not be approved without checksums if they download remote resources (exact date to be determined). This includes trusted packages.
In July 2014 Chocolatey added the ability for package maintainers to provide checksums for downloads. Over the last two years many of you have added checksums to your packages to provide an additional layer of protection for the community, thank you so much for that! We've been planning a move to requiring checksums and were hoping for a gradual
@mikecole
mikecole / gist:2a99dfea0197b724dab8
Last active August 29, 2015 14:16
Enum Display Name Dictionary
class Program
{
static void Main(string[] args)
{
var x = Operations[Operation.NotEquals];
Console.WriteLine(x);
Console.ReadKey();
}
enum Operation
@mikecole
mikecole / multiple-sources-viewmodel.cs
Created March 7, 2014 16:00
Automapper Multiple Sources
public class AccountSummaryViewModel
{
//Comes from account
public int AccountID { get; set; }
public string AccountName { get; set; }
public DateTime ExpirationDate { get; set; }
//Comes from paymentInfo
public string PaymentMethod { get; set; }
@mikecole
mikecole / multiple-sources.cs
Created March 7, 2014 15:44
Automapper Multiple Sources
public ActionResult Index(int accountId)
{
var account = _accountContext.Accounts.SingleOrDefault(acct => acct.ID == accountId);
var history = _financialContext.AccountHistory.Where(acct => acct.ID == accountId);
var paymentInfo = _paymentProcessor.GetPaymentProfile(accountId);
var sources = new Tuple<Account, IEnumerable<Transaction>, PaymentProfile>(account, history, paymentInfo);
public class Person
{
private string _firstName;
private string _lastName;
private int _age;
public string FirstName
{
get
{
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
public int Age { get; set; }
}
<asp:DropDownList ID="ddlItems" runat="server">
<asp:ListItem Text="<--Select Item-->" Value=""></asp:ListItem>
<asp:ListItem Text="Item 1" Value="1"></asp:ListItem>
<asp:ListItem Text="Item 2" Value="2"></asp:ListItem>
<asp:ListItem Text="Item 3" Value="3"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="ddlItems" runat="server" ErrorMessage="Please select an item" Text="Please select an item"></asp:RequiredFieldValidator>
private IEnumerable<string> GetItems()
{
yield return "Test1";
yield return "Test2";
yield return "Test3";
}
private IEnumerable<string> GetItems()
{
var result = new List<string>();
result.Add("Test1");
result.Add("Test2");
result.Add("Test3");
return result;
}