Skip to content

Instantly share code, notes, and snippets.

View troyscott's full-sized avatar

Troy Scott troyscott

View GitHub Profile
@troyscott
troyscott / index.html
Created June 8, 2014 21:46
Example of index.html for a EmberJS application using handlebar templates embedded in a single html file.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- Define the main application -->
@troyscott
troyscott / app.js
Created June 8, 2014 21:44
Example of a simple EmberJS application that returns a list of contacts from the local memory database (fixture adapter) or from a RESTful service if the fixture adapter is commented out. Click here for the template: https://gist.github.com/troyscott/290611f8f72a2fa7a95a
App = Ember.Application.create();
// Local In Memory Data Store
// Comment this out to defualt to the RESTful Adapter
App.ApplicationAdapter = DS.FixtureAdapter;
App.Contact = DS.Model.extend({
first: DS.attr(),
last: DS.attr(),
phone: DS.attr()
// Sample grunt-jekyll grunt.js file
// https://github.com/dannygarcia/grunt-jekyll
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
jekyll: {
<div class="row">
<div class="col-md-5">
{% include thumbnail.html name="6" %}
</div>
</div>
select fcst.* into dbo.WeeklySalesForecast
from (
select dt.CalendarYear,'Week ' + convert(nvarchar(2),dt.WeekNumberOfYear) WeekNumber ,
dt.MonthNumberOfYear, dt.EnglishMonthName, ter.SalesTerritoryGroup,
ter.SalesTerritoryRegion, cat.EnglishProductCategoryName Category,
sum(fct.OrderQuantity) LastYearQuantity, sum(fct.SalesAmount) LastYearAmount,
null ForecastQuantity, null ForecastAmount
from dbo.FactInternetSales fct inner join
create procedure dbo.BcsSalesForecastReadItem @ID nvarchar(255) as
set nocount on
select fcst.ID, fcst.MonthName, fcst.WeekNumber, fcst.SalesGroup,
fcst.SalesRegion, fcst.ProductCategory,
fcst.LastYearAmount, fcst.ForecastAmount
from ( select EnglishMonthName + '-' + WeekNumber + '-' + SalesTerritoryRegion + '-' + Category ID,
EnglishMonthName MonthName, WeekNumber, SalesTerritoryGroup SalesGroup, SalesTerritoryRegion SalesRegion,
Category ProductCategory, LastYearAmount, ForecastAmount from dbo.WeeklySalesForecast) fcst
create procedure dbo.BcsSalesForecastReadList as set nocount on
select EnglishMonthName + '-' + WeekNumber + '-' + SalesTerritoryRegion + '-' + Category ID,
EnglishMonthName MonthName, WeekNumber, SalesTerritoryGroup SalesGroup,
SalesTerritoryRegion SalesRegion, Category ProductCategory, LastYearAmount,
ForecastAmount from dbo.WeeklySalesForecast
@troyscott
troyscott / app.js
Created December 27, 2013 21:02
Podio application that uses Server Side-flow Authentication: 1. You redirect your user to Podio for authorization 2. Podio redirects back to your web app with an authorization code 3. You use the authorization code to obtain an access token 4. You use the access token for all API requests
var express = require('express');
var request = require('request');
var app = express();
app.use(express.static(__dirname + '/public'));
app.use(express.bodyParser());
var Podio = require("podio-api");
var clientId = "podio-app";
var clientSecret = "";
@troyscott
troyscott / podio_api_client.js
Created December 27, 2013 05:14
Example of using jQuery to parse timesheet data returned from nodejs podio API wrapper. PathJS is used to provide some simple routing.
console.log('ready ...');
function listTimesheets() {
var timesheets = [];
$('#add').hide();
$.ajax({
type: "GET",
dataType: "json",
url: "/timesheets"}).
@troyscott
troyscott / index.html
Created December 16, 2013 00:24
Firebug lite settings . Useful for ipad applications like Koder and Textastic.
<!doctype html>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js">
{
overrideConsole: false,