Skip to content

Instantly share code, notes, and snippets.

View ElvisLives's full-sized avatar

Peter S. ElvisLives

  • Location3 Media.
  • Denver
View GitHub Profile
@ElvisLives
ElvisLives / index.js
Created November 7, 2019 21:07 — forked from csuzw/index.js
Azure AD Single Sign On with Cypress
// This goes in cypress/plugins/index.js
const AzureAdSingleSignOn = require('./azure-ad-sso/plugin').AzureAdSingleSignOn
module.exports = (on, config) => {
on('task', {AzureAdSingleSignOn:AzureAdSingleSignOn})
}
var quotes = 0;
var maxLinks = 5;
var firstUrl = 'http://www.imdb.com/search/title?at=0&num_votes=5000,&sort=user_rating,desc&start=1&title_type=tv_infoss';
var x = require('casper').selectXPath;
var fs = require('fs');
var utils = require('utils');
var casper = require('casper').create({
verbose: true,
@ElvisLives
ElvisLives / ErrorEntity.cs
Created February 6, 2013 17:35
WindowsAzure.ELMAH.Tables (ELMAH with Windows Azure Table Storage ) ErrorEntity for updated for Azure SDK 1.8 and Storage SDK 2.0.0.0 and greater
using System;
using System.Linq;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Elmah;
using System.Collections;
using Microsoft.WindowsAzure.ServiceRuntime;
namespace YouApplicationNameHere
{
module Fizzbuzz
open System
let rangeOfNumbers = [1..100]
let isDivisible number x = (x % number) = 0
let fizzAndBuzz x = (isDivisible(3) x && isDivisible(5) x)
let answer (number:int) =
@ElvisLives
ElvisLives / RedisApiOutputCache.cs
Last active July 26, 2016 17:18
A working version of IApiOutputCache with Redis (Has some caveats around dependencies.)
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using CachingFramework.Redis;
using WebApi.OutputCache.Core.Cache;
namespace Some.Cool.NameSpace.Goes.Here
{
/// <summary>
@ElvisLives
ElvisLives / filereader-rsvp-promises-and-localstorage.htm
Created September 23, 2013 19:17
This is an example of the FileReader api, using RSVP promises, and LocalStorage. It will open two files and wait for both files to be loaded before displaying the text of both files. If you load new files and submit it will clear them out of local storage and reload them from Local Storage into the two div tags.
<html>
<head>
<script src="http://rsvpjs-builds.s3.amazonaws.com/rsvp-latest.js"></script> // "rsvp-latest.js"
// Live example at http://jsfiddle.net/Elvislives/XVv3G/3/
<title>File Reader With Promises RSVP and LocalStorage</title>
<style type="text/css">
</style>
</head>
<body>
@ElvisLives
ElvisLives / requestHandlers.js
Created November 13, 2012 16:27
A snippet with a windows dir command for people doing www.nodebeginner.org that aren't using cygwin and are running some form of Windows
var exec = require("child_process").exec;
function start(response) {
console.log("Request handler 'start' was called.");
// find all Excel files recursively
exec("dir C:\\ *.xls /s",
{ timeout: 10000, maxBuffer: 20000*1024 },
function (error, stdout, stderr) {
response.writeHead(200, {"Content-Type": "text/plain"});
@ElvisLives
ElvisLives / gist:3988101
Created October 31, 2012 16:32
Testing out dapper against sql azure
using System;
using System.Data.SqlClient;
using System.Linq;
using Dapper;
using Xunit;
namespace Dapper.Testing
{
public class DapperyQueryTest
{
@ElvisLives
ElvisLives / AzureContribFact.cs
Created October 8, 2012 15:42
Figuring Out Azure Contrib
using System;
using AzureContrib.WindowsAzure.StorageClient;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.StorageClient;
using Xunit;
namespace Tests.Azure
{
public class AzureIntegrationTests
{
@ElvisLives
ElvisLives / RavenDbIndexResharper.DotSettings
Created June 11, 2012 18:38
RavenDbIndex Resharper File Template .DotSettings
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=4CE831FF9AED4846BFBEB870FD43C301/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=4CE831FF9AED4846BFBEB870FD43C301/Description/@EntryValue">RavenDB Index</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=4CE831FF9AED4846BFBEB870FD43C301/Text/@EntryValue">using System.Linq;&#xD;
using Raven.Client.Indexes;&#xD;
&#xD;
namespace $Namespace$&#xD;
{&#xD;
public class $ClassName$ : AbstractIndexCreationTask&lt;$ClassIndexFor$, $ClassName$.ReduceResult&gt;&#xD;
{&#xD;