Skip to content

Instantly share code, notes, and snippets.

View davecowart's full-sized avatar

Dave Cowart davecowart

  • Homewood, Alabama
View GitHub Profile
@davecowart
davecowart / Alternate asset
Created February 24, 2011 20:36
The code I added to FlashAsset.ascx.cs
if (va.AlternateAssociatedLibraryAsset != null)
{
if (!String.IsNullOrEmpty(va.AlternateAssociatedLibraryAsset.FileName))
{
if (va.AlternateAssociatedLibraryAsset.FileName.StartsWith("/images/", StringComparison.CurrentCultureIgnoreCase))
this.altfilename = va.AlternateAssociatedLibraryAsset.FileName;
else
this.altfilename = ApplicationSettings.AssetLibraryImageFolder + va.AlternateAssociatedLibraryAsset.FileName;
this.altlink = va.HrefLink;
Github
Here’s the blog post about organizations on github: https://github.com/blog/674-introducing-organizations
Short version: unlimited users, pricing based off number of private repos (unlimited public) starting at $25/mo for 10 repos
Good explanation of the difference between git and svn: http://thinkvitamin.com/code/why-you-should-switch-from-subversion-to-git/
AppHarbor
Screenshot of builds list: http://screencast.com/t/f9T6ZeTi
(forgot to mention you can rollback to any previous build with one click)
Foolproof validation
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CHSweb.Models.ViewModels.PropertyDetailsViewModel>" %>
<%@ Import Namespace="CHSweb.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Details
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
<script src="/Scripts/jquery.form.js" type="text/javascript"></script>
<script src="/Scripts/PropertyEditor.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
// ==UserScript==
// @name No Comment
// @namespace http://daveandbritney.com/greasemonkey
// @description hides ALL comments on AL.com
// @include http://*.al.com/*
// ==/UserScript==
var allComments, thisComment, allReplies;
allComments = document.evaluate("//div[@class='comment']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < allComments.snapshotLength; i++) {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
namespace ConsoleApplication1 {
class Program {
static void Main(string[] args) {
int? minValue = 5;
int? maxValue = 17;