Skip to content

Instantly share code, notes, and snippets.

View elylucas's full-sized avatar

Ely Lucas elylucas

View GitHub Profile
@elylucas
elylucas / LoadOptionalDep.ts
Created October 22, 2020 23:11
demo of loading an optional dependency and erring if its not there
interface StorageProvider {
get(key: string): Promise<string | null>;
set(key: string, value: string): Promise<void>;
remove(key: string): Promise<void>;
clear(): Promise<void>;
}
export class WebStorageProvider implements StorageProvider {
constructor(private keyPrefix = 'ionic-ac-storage:') { }
(function () {
var app = angular.module('spContact');
app.factory('spAuthService', function ($http, $q) {
var authenticate = function (userId, password, url) {
var signInurl = 'https://' + url + '/_forms/default.aspx?wa=wsignin1.0';
var deferred = $q.defer();
@elylucas
elylucas / AlbumRepo.cs
Created March 7, 2011 23:34
A repository that can be used in demos as an alternative to connecting to a database. Data pulled from the MvcMusic store tutorial at mvcmusicstore.codeplex.com
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
public class Album
{
public int AlbumId { get; set; }
public string Genre { get; set; }
public string Artist { get; set; }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Dynamic;
namespace ConsoleApplication2
{
class Program
{