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
Get-AzureRmResource -ResourceGroupName "Default-Web-WestUS" -ResourceType Microsoft.Web/sites ` | |
-ResourceName prepurchasing -ApiVersion 2015-08-01 | select -expand Properties | | |
ft @{l=”OutboundIPAddresses”; e={$_.OutboundIPAddresses -split “,”}} |
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 static class MockExtensions | |
{ | |
public static Mock<DbSet<T>> MockDbSet<T>(this IQueryable<T> data) where T : class, new() | |
{ | |
var mockSet = new Mock<DbSet<T>>(); | |
mockSet.As<IQueryable<T>>().Setup(m => m.Provider).Returns(data.Provider); | |
mockSet.As<IQueryable<T>>().Setup(m => m.Expression).Returns(data.Expression); | |
mockSet.As<IQueryable<T>>().Setup(m => m.ElementType).Returns(data.ElementType); | |
mockSet.As<IQueryable<T>>().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator()); |
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
{ | |
"extends": "airbnb", | |
"plugins": [ | |
"react" | |
], | |
"env": { | |
"es6": true, | |
"jasmine": true, | |
}, | |
"rules": { |
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
(•_•) | |
( •_•)>⌐■-■ | |
(⌐■_■) |
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
git branch --merged | ?{-not ($_ -like "*master")} | %{git branch -d $_.trim()} |
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
// Load HTML file | |
var pdfDocument = new Document(stream, options); | |
//pdfDocument.FitWindow = true; | |
Font myFont = FontRepository.OpenFont(HttpContext.Current.Server.MapPath("~/fonts/ocraextended.ttf")); | |
//Font myFont = FontRepository.OpenFont(".\\fonts\\ocraextended.ttf"); | |
myFont.IsEmbedded = true; | |
//create text stamp | |
TextStamp textStamp = new TextStamp("0123456789000100000123456789"); |
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
var completed = RepositoryFactory.GiftRepository.Queryable.Where(x => x.IsCompleted).ToArray(); | |
var trans = await | |
_givingFinancialService.GetKfsAccountDetails( | |
completed.Select(c => new KfsAccountQueryParams {KfsKey = c.KfsKey}).ToArray()); | |
var grouped = trans.GroupBy(t => t.KfsKey).Select(t => new {t.Key, total = t.Sum(x => x.Amount)}); | |
var joined = from c in completed | |
join g in grouped on c.KfsKey equals g.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
var alertController = UIAlertController.Create (null, null, UIAlertControllerStyle.Alert); | |
alertController.AddAction (UIAlertAction.Create ("Cancel", UIAlertActionStyle.Cancel, null)); | |
alertController.AddAction (UIAlertAction.Create ("Take photo", UIAlertActionStyle.Default, null)); | |
alertController.AddAction (UIAlertAction.Create ("Take photo", UIAlertActionStyle.Default, null)); | |
this.PresentViewController (alertController, true, null); |
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
select * from Gifts where Status = 'Completed' and StatusLevel = 10 --if any results we are on old scheme | |
update Gifts set StatusLevel = StatusLevel + 1 where StatusLevel > 5 --move all gifts financial review or higher up a level | |
update Gifts set StatusLevel = StatusLevel + 2 where StatusLevel = 5 --move from financial hold to financial review |
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
const string placeQuery = "http://api.v3.factual.com/t/places?geo={\"$point\":[38.544401,-121.742229]}"; | |
using (var client = new HttpClient()) | |
{ | |
var header = Xamarin.Auth.OAuth1.GetAuthorizationHeader ("GET", new Uri ("http://api.v3.factual.com/t/places"), new Dictionary<string,string> { {"geo","{\"$point\":[38.544401,-121.742229]}"} }, | |
"key", "secret", string.Empty, string.Empty); | |
client.DefaultRequestHeaders.Add("Authorization", header); | |
var res = client.GetAsync(placeQuery).Result; | |
// res.EnsureSuccessStatusCode(); |