Skip to content

Instantly share code, notes, and snippets.

Page = require 'Utils/Page'
class AddOwnerPage extends Page
get: ->
super "/management/owners/create"
class Page
constructor: ->
# this is singleton
@ptor = protractor.getInstance()
get: (relativeUrl, ignoreSync) ->
# we want to ignore sync if the
# page does not use AngularJS
@ptor.ignoreSynchronization = ignoreSync or false
@ptor.get @ptor.baseUrl + relativeUrl
@misaxi
misaxi / Page.coffee
Last active August 29, 2015 13:55
A base Page object class which wraps
class Page
constructor: ->
# this is singleton
@ptor = protractor.getInstance()
get: (relativeUrl, ignoreSync) ->
# we want to ignore sync if the
# page does not use AngularJS
@ptor.ignoreSynchronization = ignoreSync or false
@ptor.get @ptor.baseUrl + relativeUrl
@misaxi
misaxi / ConfigIssuerNameRegistry.cs
Last active January 4, 2016 02:19
After creating an ASP.NET MVC 5 project integrate with Organisational Accounts. There are a few Windows Azure Active Directory things configured automatically. A LocalDB is used to check issuer keys and tenants which is not necessary tho. ConfigIssuerNameRegistry is used to check those things based on web.config.
using System.Configuration;
using System.IdentityModel.Tokens;
using System.Linq;
namespace Rockend.Bedrock.Web.Admin.Utils.AzureAD
{
public class ConfigIssuerNameRegistry : ValidatingIssuerNameRegistry
{
static readonly string[] TenantIds = ConfigurationManager.AppSettings["ida:TenentIds"].Split('|').Select(n => n.Trim()).ToArray();
static readonly string[] IssuerKeys = ConfigurationManager.AppSettings["ida:IssuerKeys"].Split('|').Select(n => n.Trim()).ToArray();
using System;
namespace RsaKeyConverter.Converter
{
public static class BytesExtensions
{
public static string ToBase64(this byte[] bytes)
{
return Convert.ToBase64String(bytes);
}
@misaxi
misaxi / gist:1475275
Created December 14, 2011 04:35
run admin command via mongo C# driver
Server.RunAdminCommand(
new CommandDocument(
new Dictionary<string, object>
{
{"setParameter", 1},
{"notablescan", false}
}));