This file contains hidden or 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
// 1. Set the species attributes | |
var species = new Species(); | |
species.Name = "ant"; | |
// Determine how your animal looks like | |
species.Skin = AnimalSkin.ant; // options: ant, beetle, inchworm, scorpion or spider | |
// How big can your creature grow? | |
// The bigger the more powerful it is, but the slower it is to reproduce. | |
species.MatureSize = 24; // between 24 and 48 |
This file contains hidden or 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
// 1. Set the species attributes | |
var species = new Species(); | |
species.Name = "ant"; | |
// Determine how your animal looks like | |
species.Skin = AnimalSkin.ant; // options: ant, beetle, inchworm, scorpion or spider | |
// How big can your creature grow? | |
// The bigger the more powerful it is, but the slower it is to reproduce. | |
species.MatureSize = 24; // between 24 and 48 |
This file contains hidden or 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
// 1. Set the species attributes | |
var species = new Species(); | |
species.Name = "ant"; | |
// Determine how your animal looks like | |
species.Skin = AnimalSkin.ant; // options: ant, beetle, inchworm, scorpion or spider | |
// How big can your creature grow? | |
// The bigger the more powerful it is, but the slower it is to reproduce. | |
species.MatureSize = 24; // between 24 and 48 |
This file contains hidden or 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 CorsMessageHandler : DelegatingHandler | |
{ | |
const string Origin = "Origin"; | |
const string AccessControlRequestMethod = "Access-Control-Request-Method"; | |
const string AccessControlRequestHeaders = "Access-Control-Request-Headers"; | |
const string AccessControlAllowOrigin = "Access-Control-Allow-Origin"; | |
const string AccessControlAllowMethods = "Access-Control-Allow-Methods"; | |
const string AccessControlAllowHeaders = "Access-Control-Allow-Headers"; | |
const string AccessControlAllowCredentials = "Access-Control-Allow-Credentials"; |
This file contains hidden or 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
port 1194 | |
proto udp | |
# "dev tun" will create a routed IP tunnel, | |
# "dev tap" will create an ethernet tunnel. | |
dev tun | |
ca /etc/openvpn/server/ca.crt | |
cert /etc/openvpn/server/server.crt | |
key /etc/openvpn/server/server.key # This file should be kept secret |
This file contains hidden or 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
[HttpPost] | |
[ValidateInput(false)] | |
public ActionResult ProcessIncomingEmail(IncomingEmail email) | |
{ | |
var serializer = new JavaScriptSerializer(); | |
serializer.RegisterConverters(new[] { new DynamicJsonConverter() }); | |
email.envelope = serializer.Deserialize(HttpContext.Request.Form["envelope"], typeof(object)); | |
// Parse incoming to: email address | |
// Do something |
This file contains hidden or 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 ActionResult Unsubscribed(string id) | |
{ | |
_userService.UnsubscribeFromEmails(id); | |
return View(); | |
} |
This file contains hidden or 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
//before | |
var weeklyReview = Db.WeeklyReviews | |
.Include(x => x.WeeklyGoals) | |
.SingleOrDefault(x => x.WorkspaceId == workspace.WorkspaceId && x.WeekDate == weekStart.WeeklyReviewDay(workspace.StartOfWeek)); | |
// after | |
var weeklyReviewDay = weekStart.WeeklyReviewDay(workspace.StartOfWeek); | |
var weeklyReview = Db.WeeklyReviews | |
.Include(x => x.WeeklyGoals) |
This file contains hidden or 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
Mailer.Invitation(emailAddresses.ToArray(), LoggedInUser.Name, inviteMessage).Send(); |
This file contains hidden or 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 Team | |
{ | |
public List<Player> Players { get; set; } | |
public int TotalRuns | |
{ | |
get | |
{ | |
return Players.Sum(player => player.Runs); | |
} | |
} |