Skip to content

Instantly share code, notes, and snippets.

@NathanGloyn
NathanGloyn / StockTicker.cs
Created August 8, 2012 06:30
Code failing to property weave
using System.ComponentModel;
namespace PropertyWeave
{
public class StockTicker : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public string MessageBoxMessage { get; set; }
@NathanGloyn
NathanGloyn / gist:3713359
Created September 13, 2012 10:09
Raven query
[HttpPost]
public ActionResult Create(Create_Album album)
{
if(ModelState.IsValid)
{
var newAlbum = new Album();
newAlbum.Genre = session.Load<Genre>(album.GenreId);
newAlbum.Title = album.Title;
newAlbum.CountSold = album.CountSold;
newAlbum.Price = album.Price;
@NathanGloyn
NathanGloyn / Global.asax.cs
Created June 10, 2013 13:01
Configuration of Thinktecture.Identity45 where attempting to set FormsAuth cookie and use that for authentication
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
ConfigureGlobal(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
@NathanGloyn
NathanGloyn / Sample_Api_Controller.cs
Created June 19, 2013 11:33
Sample Web Api controller which uses actions against a resource using same verb. How could this be done in a verb only form?
using System.Net;
using System.Net.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using Sample.Repository
namespace Sample.Controllers
{
@NathanGloyn
NathanGloyn / Home.js
Last active December 19, 2015 02:28
Files to create example of angular-ui dialog not clearing up scopes
app.controller("HomeController", ["$scope", "$dialog", function ($scope, $dialog) {
var t = '<div>' +
'<button ng-click="close(result)" class="btn btn-primary" >Close</button>' +
'</div>';
$scope.opts = {
backdrop: true,
keyboard: true,
backdropClick: true,
function LoginFlow() {
this.loginPage = new LoginPage(driver); // another question is how to provide the driver, global or parameter?
function login(username, password){
loginPage.userName.text = username;
loginPage.password.text = password;
loginPage.loginButton.click();
dalek.waitFor(window.document.title == 'Home'); // ideally wouldn't want to have to use dalek, driver would be better
}