Skip to content

Instantly share code, notes, and snippets.

View chris-brown's full-sized avatar

Chris chris-brown

View GitHub Profile
@chris-brown
chris-brown / comma-deliminate-rows
Created December 29, 2014 13:20
Comma deliminate a collection a data to a singe column
GO
DECLARE @tableName VARCHAR(MAX)
SELECT @tableName = COALESCE(@tableName + ',' ,'') + Name
FROM sys.tables
SELECT @tableName
GO
@chris-brown
chris-brown / index.html
Created December 23, 2014 23:36
simple markup for handlebars demo
<!DOCTYPE html>
<html>
<head>
<title>My demo</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="scripts/handlebars.runtime.min.js"></script>
<script type="text/javascript" src="scripts/handlebars-templates.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body>
@chris-brown
chris-brown / app.js
Created December 23, 2014 23:29
renders handlebar template from github api data
(function ($j) {
"use strict";
var app = {
query: 'https://api.github.com/users/chris-brown/repos',
containerId: '#container',
init: function(){
@chris-brown
chris-brown / Gruntfile.js
Created December 23, 2014 23:05
grunt-handlebars-compiler Gruntfile.js
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
handlebars: {
compile: {
src: 'templates/*.handlebars',
dest: 'scripts/handlebars-templates.js'
}