Skip to content

Instantly share code, notes, and snippets.

View osbornm's full-sized avatar

Matthew Osborn osbornm

View GitHub Profile
<section class="release">
<h2>NuGet 1.6 Coming Soon!</h2>
<p>
NuGet 1.6 is coming soon so stay tuned for more information! Why, wait though NuGet 1.5 has already been released so
head over to our docs site and <a href="http://docs.nuget.org/docs/release-notes/nuget-1.5">read all the details</a> of that release.
</p>
</section>
@osbornm
osbornm / gist:1960960
Created March 2, 2012 20:11
NuGet Gallery Footer
if ($commitSha -eq $null) {
$commitSha = (& "$gitPath" rev-parse HEAD)
}
if ($commitBranch -eq $null) {
$commitBranch = (& "$gitPath" name-rev --name-only HEAD)
}
@osbornm
osbornm / jshint.formatters.js
Last active October 13, 2015 06:17
JSHint Formatters to get Visual Studio auto link to files, etc.
var formatters = {
errors: function (errors, lines, file) {
var i, error;
for (i = 0; i < errors.length; i++) {
error = errors[i];
if (!error) continue;
lines.push(file + '(' + error.line + ',' + error.character + '): error JSHint: ' + error.reason);
}
},
@osbornm
osbornm / gist:4431513
Last active May 28, 2021 18:05
NAudio Playlist
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
var playlist = new List<string>{ @"c:\development\test\sound.MP3",
@"c:\development\test\sound2.MP3" };
var playr = new playr(playlist);
@osbornm
osbornm / gist:5043549
Created February 26, 2013 23:58
Knockout Widget Binding - Why does Knockout not have one of these built in?
function _getWidgetBindings(element, valueAccessor, allBindingsAccessor) {
var value = valueAccessor(),
myBinding = ko.utils.unwrapObservable(value),
allBindings = allBindingsAccessor();
if (typeof (myBinding) === 'string') {
myBinding = { 'name': myBinding };
}
var widgetName = myBinding.name,
<!-- Simple Binding -->
<input type="submit" value="OK" data-bind='widget: "button"' />
<!-- Complex Binding with options -->
<input id='search' data-bind='widget: { name: "autocomplete", options: { source: searchCompletions(), delay: 500 } }, value: searchString' />
@osbornm
osbornm / example.js
Created February 27, 2013 05:11
Knockout.js Trackable Observable
var model = ko.trackableObservable(value);
$(".cancel").click(function(){
model.reset();
});
@osbornm
osbornm / handlebars.tmpl.html
Last active July 10, 2016 02:46
ko.handlebars.js template enigne
<script type="text/x-handlebars-template" id="tree-layout-group">
<li>
<div class="tree-row tree-row-header" data-bind="click: $root.toggleTreeNode">
<div class="tree-row-left">
<hgroup>
<h2><i class="{{groupIconClass}}"></i>{{name}}</h2>
<h3>({{serverCount}})</h3>
</hgroup>
</div>
<div class="tree-row-right">
@osbornm
osbornm / index.html
Created December 5, 2013 23:56
Animated Loading Background for i tag style Icons.
<i class="loading-wave"></i>
@osbornm
osbornm / anyEmptyBindings.js
Last active August 29, 2015 14:00
Any & Empty Bindings
function hasItems(data) {
var value = ko.unwrap(data),
result = false;
if (value.length && value.length > 0)
result = true;
return result;
}