Skip to content

Instantly share code, notes, and snippets.

Nelson LaQuet nelsonlaquet

Block or report user

Report or block nelsonlaquet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:674705
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")
View gist:674710
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");
};
View gist:958026
using System;
namespace ConsoleApplication61
{
class Vector
{
public int X { get; private set; }
public Vector() { }
View Test.cpp
#include <iostream>
#include <string>
class CanOnlyGuess2
{
private:
int _channelPerNameCount;
std::string _channel;
std::string _prevName;
View gist:971294
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;
}
View Example1.haml
%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
View gist:1040907
<?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>
View gist:1052413
[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));
}
View gist:1057983
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;
View gist:1110558
class SanguineBond : CastableCard, IEnchantment, IEventHandler<PlayerLifeChanged>
{
public SanguineBond()
{
Name = "Sanguine Bond";
ManaCost = Manacost.Create(black: 4, collorless: 2);
Description = "Whenever you gain life, target opponent loses that much life.";
}
public void Handle(PlayerLifeChanged @event)
You can’t perform that action at this time.