Skip to content

Instantly share code, notes, and snippets.

View nelsonlaquet's full-sized avatar

Nelson LaQuet nelsonlaquet

  • Amazon Web Services
  • Palo Alto, CA
View GitHub Profile
UpdateSaveMessage = () ->
[cls, message] =
if $("#Entry_Status").val() == "Draft"
["warning", "saved as a draft"]
else
[
"info",
"posted to your blog, and published " +
if $("#publish-on-date").val().length
"on " + $("#publish-on-date").val() + " at " + ($("#publish-on-time").val() || "12:00 pm")
UpdateSaveMessage = function () {
var _a, cls, message;
_a = $("#Entry_Status").val() === "Draft" ? ["warning", "saved as a draft"] : ["info", "posted to your blog, and published " + ($("#publish-on-date").val().length ? "on " + $("#publish-on-date").val() + " at " + ($("#publish-on-time").val() || "12:00 pm") : "immediately")];
cls = _a[0];
message = _a[1];
return $("#save-message").text(message).parent(".submit-row").attr("class", cls + " submit-row");
};
using System;
namespace ConsoleApplication61
{
class Vector
{
public int X { get; private set; }
public Vector() { }
#include <iostream>
#include <string>
class CanOnlyGuess2
{
private:
int _channelPerNameCount;
std::string _channel;
std::string _prevName;
public string GetMimeTypeForFile(string filename)
{
var mime = "application/octetstream";
var ext = System.IO.Path.GetExtension(filename).ToLower();
var rk = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(ext);
if (rk != null && rk.GetValue("Content Type") != null)
mime = rk.GetValue("Content Type").ToString();
return mime;
}
%ul.site-navigation
%li != Html.RouteLink("Dashboard").Dashboard
%li != Html.RouteLink("Projects").ListProjects
%li != Html.RouteLink("Account").Account
%li != Html.RouteLink("Logout").Logout
...
-foreach (var project in Model.Projects)
%tr
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<appSettings>
<add key="AccessToken" value="" />
<add key="AccessTokenSecret" value="" />
<add key="RequestToken" value="" />
</appSettings>
</configuration>
[EnsureCustomerLoggedIn]
public ActionResult Download(Guid assetId)
{
var asset = _assets.GetAsset(assetId);
if (asset == null)
return Redirect(Url.RouteCatalog());
var filePath = _uploads.GetAbsolutePathForFile(asset.FileId.UploadId);
return File(filePath, _mimeTypes.GetMimeTypeForFile(filePath), asset.Name + Path.GetExtension(filePath));
}
using System;
using System.Linq;
using System.Collections.Generic;
using System.Reflection;
using FluentNHibernate.Automapping;
using FluentNHibernate.Cfg;
using FluentNHibernate.Conventions;
using FluentNHibernate.Conventions.Helpers;
using FluentNHibernate.Conventions.Instances;
using FluentNHibernate.MappingModel;
class MurasaPyromancer : CreatureCard, IAlly, IEventHandler<CreaterEntersBattlefield>
{
public MurasaPyromancer()
{
Name = "Murasa Pyromancer";
ManaCost = ManaCost.Create(red: 2, collorless: 4);
Description = "Whenever Murasa Pyromancer or another Ally enters the battlefield under your control, you may have Murasa Pyromancer deal damage to target creature equal to the number of Allies you control.";
}
public void Handle(CreaterEntersBattlefield @event)