This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Fams.EnumSelector { | |
interface IScope extends ng.IScope | |
{ | |
promise; | |
loaded(); | |
onLoad(); | |
} | |
function directiveFactory() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
t.NAME AS TableName, | |
s.Name AS SchemaName, | |
p.rows AS RowCounts, | |
SUM(a.total_pages) * 8 AS TotalSpaceKB, | |
SUM(a.used_pages) * 8 AS UsedSpaceKB, | |
(SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB | |
FROM | |
sys.tables t | |
INNER JOIN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IResult | |
{ | |
bool WasSuccessful { get; } | |
string[] Errors { get; } | |
bool WasFailure { get; } | |
} | |
public class Result : IResult | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="../../app.ts"/> | |
module Foo.AddBarAuditLink { | |
class Controller { | |
barId: number; | |
constructor($scope, $modal) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function humanTimestampDirective($interval: ng.IIntervalService): ng.IDirective { | |
function link(scope, element, attrs) { | |
var timeoutId; | |
var date; | |
function apply() { | |
var humanised; | |
if (date) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.config(['$httpProvider', function ($httpProvider) { | |
//initialize get if not there | |
if (!$httpProvider.defaults.headers.get) { | |
$httpProvider.defaults.headers.get = {}; | |
} | |
//disable IE ajax request caching | |
$httpProvider.defaults.headers.get['If-Modified-Since'] = '0'; | |
}]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function httpErrorHandler($httpProvider: ng.IHttpProvider) { | |
var interceptor = ($q: ng.IQService) => { | |
return { | |
'requestError': response => { | |
toastr.error(response.message || response.statusText || "An error occured"); | |
return $q.reject(response); | |
}, | |
'responseError': response => { | |
var error = (response.data && response.data.errors) || response.statusText || "An error occured"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
IDb db; | |
new PersonNameProjection( | |
new PersonQuery(db.Table<Person>()).ByName("Tod") | |
).Execute(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 3s/day | |
c:\temp\gource\gource.exe -o out.ppm -r 25 -s 3 -a 1 --colour-images --hide filenames | |
c:\temp\ffmpeg\bin\ffmpeg -y -b 3000K -r 60 -f image2pipe -vcodec ppm -i out.ppm -vcodec libx264 -threads 0 gource..avi -fpre "c:\temp\ffmpeg\presets\libvpx-720p.ffpreset" | |
// Fast 1s/day | |
c:\temp\gource\gource.exe -o out.fast.ppm -r 25 -s 1 -a 1 --colour-images --hide filenames --font-size 6 | |
c:\temp\ffmpeg\bin\ffmpeg -y -b 3000K -r 60 -f image2pipe -vcodec ppm -i out.fast.ppm -vcodec libx264 -threads 0 gource.fast.avi -fpre "c:\temp\ffmpeg\presets\libvpx-720p.ffpreset" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GenerateInvoice | |
{ | |
private readonly IApiDogfoodingClient<Api.ElectricityInvoiceController> _apiElectricityController | |
public async Task<ActionResult> Invoice(int id) | |
{ | |
var invoice = await _apiElectricityController.Get(c => c.Get(id)); | |
return new PdfReportResult<ElectricityInvoiceReport>(invoice); | |
} | |
} |