This file contains 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 DataBase<T> where T : class, IDbConnection, new() | |
{ | |
//connection string | |
private string ConnectionString { get; set; } | |
//connection string in constructor | |
public DatabaseBase(string connectionstring) | |
{ | |
//if its null or empty throw error | |
if (string.IsNullOrWhiteSpace(connectionstring)) throw new ArgumentNullException("connectionstring"); | |
ConnectionString = connectionstring; |
This file contains 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.Reflection; | |
using System.Linq; | |
using System.Runtime.CompilerServices; | |
using System.Collections.Generic; | |
namespace MyApp.AppStart | |
{ | |
public static class Primer | |
{ |
This file contains 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 partial class Service1 : ServiceBase | |
{ | |
private Timer timer = new Timer(300000); | |
public Service1() | |
{ | |
InitializeComponent(); | |
} | |
protected override void OnStart(string[] args) |
This file contains 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
void Main() | |
{ | |
var next5Friday13 = DateTime.Today | |
.Recurse(a=>a.AddDays(1)) | |
.Where(a=>a.Day == 13 && a.DayOfWeek == DayOfWeek.Friday).Take(5); | |
} | |
public static class Extension | |
{ | |
public static IEnumerable<T> Recurse<T>(this T obj, Func<T,T> action) |
This file contains 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
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="SpecificRewrite" stopProcessing="true"> | |
<match url="^rss$" /> | |
<action type="Rewrite" url="public/rss.xml" /> | |
</rule> | |
</rules> | |
</system.webServer> |
This file contains 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 async Task UploadArtifact(S3Config config, IAmazonS3 s3Client) | |
{ | |
using(var utility = new TransferUtility(s3Client)) | |
{ | |
Console.WriteLine($"Uploading artifact {config.ArtifactRelativePath} {config.Key}"); | |
await utility.UploadAsync(filePath: config.ArtifactRelativePath, bucketName: config.S3Bucket, key: config.Key); | |
} | |
} |
This file contains 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
#!/bin/bash | |
sudo apt-get update -y | |
sudo apt-get install git aptitude puppet -y | |
sudo aptitude install ruby2.0 -y | |
wget https://releases.hashicorp.com/vagrant/1.7.4/vagrant_1.7.4_x86_64.deb | |
dpkg --install vagrant_1.7.4_x86_64.deb | |
vagrant plugin install vagrant-managed-servers --plugin-version 0.6.0 | |
vagrant plugin install vagrant-orchestrate | |
gem install librarian-puppet |
This file contains 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 Hl7.Fhir.Model; | |
internal class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
var client = new Hl7.Fhir.Rest.FhirClient("http://52.72.172.54:8080/fhir/baseDstu2/"); | |
var result = client.Read<Patient>("Patient/Patient-19454"); | |
var allergyResult = client.Read<AllergyIntolerance>("AllergyIntolerance/AllergyIntolerance-19454"); | |
} | |
} |
This file contains 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 main | |
{ | |
public string awesome {get;set;} | |
public string dawg {get {return "yo dawg"}} | |
public string coolio {get; private set;} | |
public string customSet {get; set{this = value}} | |
} | |
public class student{ | |
public string FirstName {get;set;} | |
public string LastName {get;set;} |
This file contains 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 IEnumerable<string> DetermineListOfAllergicMedications(List<string> medications, Dictionary<string, bool> lookupPatientsKnownAllergies) | |
{ | |
return | |
medications | |
.Where(a => allergyLookup.ContainsKey(a)) | |
.Select(a => new Tuple<string, List<string>>(a, allergyLookup[a])) | |
.Where(a => a.Item2.Any(c => lookupPatientsKnownAllergies.ContainsKey(c))) | |
.Select(a => a.Item1); | |
} |
OlderNewer