This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Security; | |
using DotNetOpenAuth.Messaging; | |
using DotNetOpenAuth.OpenId; | |
using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration; | |
using DotNetOpenAuth.OpenId.RelyingParty; | |
namespace CRP.Authentication |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LogonTime | |
{ | |
public DayOfWeek DayOfWeek { get; set; } | |
public DateTime BeginTime { get; set; } | |
public DateTime EndTime { get; set; } | |
public LogonTime(DayOfWeek dayOfWeek, DateTime beginTime, DateTime endTime) | |
{ | |
DayOfWeek = dayOfWeek; | |
BeginTime = beginTime; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ExchangeFunctions | |
{ | |
private const string _username = "uname"; | |
private const string _password = "password"; | |
private const string _domain = "domain"; | |
public static string CreateAppointment(string mailboxId, MyAppointment appt) | |
{ | |
var service = new ExchangeService(ExchangeVersion.Exchange2007_SP1); | |
service.Credentials = new WebCredentials(_username, _password, _domain); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private readonly string _storageUrl; | |
private readonly string _serverName; | |
private readonly string _sqlUsername; | |
private readonly string _sqlPassword; | |
private readonly string _storageAccountName; | |
private readonly string _storageKey; | |
private readonly string _storageContainer; | |
public string Backup(string database, string[] selectedTables, out string filename) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private readonly string _storageAccountName; | |
private readonly string _storageKey; | |
private readonly string _storageContainer; | |
private readonly int _cleanupThreshold; | |
private const string CloudStorageconnectionString = @"DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}"; | |
public IEnumerable<string> BlobCleanup() | |
{ | |
var storageAccount = CloudStorageAccount.Parse(string.Format(CloudStorageconnectionString, _storageAccountName, _storageKey)); | |
var client = storageAccount.CreateCloudBlobClient(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inline method | |
var students = ( | |
from student in RepositoryFactory.StudentRepository.Queryable | |
select new { FirstName = student.FirstName, LastName = student.LastName, FullName = string.Format("{0} {1}", student.FirstName, student.LastName) } | |
).ToList(); | |
// using the let key word, looks cleaner | |
var students = ( | |
from student in RepositoryFactory.StudentRepository.Queryable | |
let fullname = string.Format("{0} {1}", student.FirstName, student.LastName) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model.SectionDetails = (from section in repositoryFactory.SectionRepository.Queryable | |
let sequence = section.Course.CrossListedCourse == null ? section.Sequence : string.Format("{0} ({1} {2})", section.Sequence, section.Course.Subject, section.Course.CourseNumb) | |
let students = (decimal)section.ClassTimes.SelectMany(a => a.Students).Select(a => a.LoginId).Distinct().Count() | |
let responses = (decimal)section.ClassTimes.SelectMany(a => a.ClassTimeEvaluations).SelectMany(a => a.EvaluationResponses).Count() | |
let evals = section.ClassTimes.SelectMany(a => a.ClassTimeEvaluations).Count() | |
let instructors = section.ClassTimes.SelectMany(a => a.Instructors) | |
where section.Course == course || section.Course.CrossListedCourse == course | |
select new SectionDetail() { SectionId = section.Id, Sequence = sequence, | |
Students = (int)students, ResponseRate = ((responses)/(students*evals))*100, | |
InstructorList = instructors} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
become: yes | |
tasks: | |
- name: directory | |
file: | |
path: /opt/sonarqube | |
state: directory | |
- name: download/install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
become: yes | |
tasks: | |
- name: directory | |
file: | |
path: /opt/sonarqube | |
state: directory | |
- name: download/install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const localizeDateTime = (function(){ | |
window.addEventListener('load', function(){ | |
const toLocalize = document.querySelectorAll('.localize-datetime'); | |
toLocalize.forEach(element => { | |
let input = element.innerHTML; | |
let date = new Date(input); | |
element.innerHTML = `${date.toLocaleDateString()} ${date.toLocaleTimeString()}` | |
}); | |
}); |
OlderNewer