Skip to content

Instantly share code, notes, and snippets.

View bchallenor's full-sized avatar

Ben Challenor bchallenor

View GitHub Profile
@bchallenor
bchallenor / gist:4655419
Last active December 11, 2015 20:28
Git aliases to ignore changes to tracked files (similar to TortoiseSVN's "ignore-on-commit" changelist)
[alias]
skip = update-index --skip-worktree
noskip = update-index --no-skip-worktree
skipped = !git ls-files -v | grep "^S"
@bchallenor
bchallenor / AggHash.sql
Created October 24, 2012 00:32
Using an indexed view performing an aggregate hash to find table subsets
USE AggHash
DROP VIEW dbo.GroupCountriesHashes
DROP TABLE dbo.GroupCountries
DROP TABLE dbo.Groups
DROP TABLE dbo.Countries
CREATE TABLE dbo.Countries
(
CountryId INT NOT NULL,
@bchallenor
bchallenor / knockout-templates-proposal.md
Created August 2, 2011 23:22
Knockout Templates Proposal

Knockout Templates Proposal

Rationale

Knockout is an elegant solution for binding a pure view model to a view. However, its current templating system has several problems:

  • Templates are second-class citizens. Placing the template inside a script element breaks the great highlighting, intellisense and validation abilities of IDEs.
  • jQuery.templ is based on string manipulation and does not enforce well-nested HTML. This can cause validation issues that do not appear until runtime.
  • jQuery.templ encourages the use of the {{ }} syntax, but this syntax circumvents Knockout's dependency analysis.
  • jQuery.templ adds a dependency on the jQuery library. While many developers will be using jQuery already, it adds unnecessary overhead if they prefer to use a different library.