Popular Posts

Saturday, November 11, 2017

Deploying an Angular CLI project using VSTS Build and Release - Seth Reid Blog

Step 1: Follow John Papa's steps except don't create a web config (keep it unticked)



https://johnpapa.net/deploy-angular-to-azure-vsts-angular-cli/ 



Step 2: add the web config based on this:



Deploying an Angular CLI project using VSTS Build and Release - Seth Reid Blog:



e.g. in the root folder of the app:



<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="AngularJS Routes" stopProcessing="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="Rewrite" url="/" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>


'via Blog this'

Wednesday, November 1, 2017

Angular fire auth

https://coursetro.com/posts/code/32/Create-a-Full-Angular-Authentication-System-with-Firebase

Saturday, October 28, 2017

Sunday, October 22, 2017

vscode deploy angular 4 app to azure - Google Search

vscode deploy angular 4 app to azure - Google Search



https://medium.com/@flu.lund/setting-up-a-ci-pipeline-for-deploying-your-angular-application-to-azure-using-visual-studio-team-f686c8f190cf



https://johnpapa.net/deploy-angular-to-azure-vsts-angular-cli/

Saturday, October 21, 2017

ajax - How to support HTTP OPTIONS verb in ASP.NET MVC/WebAPI application - Stack Overflow

ajax - How to support HTTP OPTIONS verb in ASP.NET MVC/WebAPI application - Stack Overflow: "public class AllowOptionsHandler : DelegatingHandler
{
protected override async Task SendAsync(
HttpRequestMessage request, CancellationToken cancellationToken)
{
var response = await base.SendAsync(request, cancellationToken);

if (request.Method == HttpMethod.Options



Enable cors for Angular 4 otherwise when adding new record it will fail

Tuesday, October 17, 2017

Wpf cross platform?

http://feeds.hanselman.com/~/460352386/0/scotthanselman~What-would-a-crossplatform-NET-UI-Framework-look-like-Exploring-Avalonia.aspx

Saturday, October 14, 2017

Monday, August 21, 2017

Deploying java to azure

https://azure.microsoft.com/blog/maven-deploy-java-web-apps-to-azure/

Refit as retrofit rest client libraray that works with interface

http://feeds.hanselman.com/~/436136948/0/scotthanselman~Exploring-refit-an-automatic-typesafe-REST-library-for-NET-Standard.aspx

Sunday, July 30, 2017

Installing application insights in iis

https://social.technet.microsoft.com/wiki/contents/articles/34449.iis-application-insight-integration.aspx

Saturday, July 22, 2017

JSONPlaceholder - Fake online REST API for developers

JSONPlaceholder - Fake online REST API for developers





using power shell to do a rest api call:



#Reading feeds from PowerShell team blog

$feeds = Invoke-RestMethod http://blogs.msdn.com/b/powershell/atom.aspx

#Filtering and Formatting results

$feeds | ForEach {

    [PSCustomObject]@{

        Title=$_.title;

        Author=$_.author.name;

        Link=$_.link.href;

        Date=$_.published

     }

} | ConvertTo-Json  OR Format-List

Wednesday, June 28, 2017

Winform databinding in new way

https://www.codeproject.com/Articles/1193797/Postulate-WinForms-a-new-look-at-data-binding

Thursday, June 8, 2017

Goldcost

https://www.destinationgoldcoast.com/gold-coast-holiday-deals?utm_source=cadreon&utm_medium=facebook&utm_campaign=brand_launch2&utm_content=multi_product_hilton

Saturday, May 20, 2017

JS Dump from VS Code:




function abc(id) {

var countriesSubscription = [
{ Exchange: 'ASX', CountryId: 1, ExchangeRate: 1, CountryName: "Australia", Code: "AU", CurrencyForeign: "AUD", CurrencyLocal: "AUD", IsSubscribed: true, PriceLocal: 15.75, PriceForeign: null, DataType: "ClickToRefresh" },
{ Exchange: 'ASX', CountryId: 2, ExchangeRate: 1.01, CountryName: "Canada", Code: "CAN", CurrencyForeign: "CAD", CurrencyLocal: "AUD", IsSubscribed: false, PriceLocal: null, PriceForeign: null, DataType: "" },
{ Exchange: 'ASX', CountryId: 3, ExchangeRate: 5.78, CountryName: "Hong Kong", Code: "HKG", CurrencyForeign: "HKD", CurrencyLocal: "AUD", IsSubscribed: false, PriceLocal: null, PriceForeign: null, DataType: "" },
{ Exchange: 'CHIX', CountryId: 4, ExchangeRate: 0.74, CountryName: "US", Code: "USA", CurrencyForeign: "USD", CurrencyLocal: "AUD", IsSubscribed: true, PriceLocal: null, PriceForeign: null, DataType: "" },
{ Exchange: 'ASX', CountryId: 5, ExchangeRate: 0.67, CountryName: "France", Code: "FRA", CurrencyForeign: "EUR", CurrencyLocal: "AUD", IsSubscribed: false, PriceLocal: null, PriceForeign: null, DataType: "" },
{ Exchange: 'CHIX', CountryId: 6, ExchangeRate: 1.37, CountryName: "Switzerland", Code: "CHE", CurrencyForeign: "CHF", CurrencyLocal: "AUD", IsSubscribed: true, PriceLocal: null, PriceForeign: null, DataType: "" },
{ Exchange: 'ASX', CountryId: 7, ExchangeRate: 0.73, CountryName: "Belgium", Code: "BEL", CurrencyForeign: "EUR", CurrencyLocal: "AUD", IsSubscribed: false, PriceLocal: null, PriceForeign: null, DataType: "" },
];

countriesSubscription.forEach(function (element) {
if (element.CountryId === id) {
element.IsSubscribed = true;
return;
}
});

for (var index = 0; index < countriesSubscription.length; index++) {
var element = countriesSubscription[index];
console.log(element.CountryName + ' ' + element.IsSubscribed);
}

// Use map function
var result = countriesSubscription.map(function (element) {
return element.CurrencyLocal + " " + element.PriceLocal;
});

result.forEach(function (element) {
console.log(element);
}, this);

// reduce array of objects to dictionary
var countryDictionary = countriesSubscription.reduce(function (o, v) {
o[v.CountryId] = v;
return o;
}, {});

console.log(countryDictionary[1]);
console.log(countryDictionary[1].CountryName);
console.log(countryDictionary[2]);
console.log(countryDictionary[2].CountryName);

// Find index of element
Array.prototype.indexOfObject = function countriesSubscription(property, value) {
for (var i = 0, len = this.length; i < len; i++) {
if (this[i][property] === value) return i;
}
return -1;
}

var result = countriesSubscription.indexOfObject("CountryName", "Canada");
console.log(result);

result = countriesSubscription.map(function (e) { return e.CountryName; }).indexOf('Canada');
console.log(result);
console.log(countriesSubscription[result].CountryName);

// **** Array to group by Exchange ****
var groupByCurrency = countriesSubscription.reduce(function(all, item, index){
all[item.Exchange].push(item);
return all;
}, {CHIX:[], ASX:[]});

groupByCurrency.ASX.forEach(function(item){
console.log(item);
})

groupByCurrency.CHIX.forEach(function(item){
console.log(item);
})

// Custom function that loops and finds

countrySearch = function (array, callback) {
for (var key in countriesSubscription) {
if (callback(countriesSubscription[key])) {
return countriesSubscription[key];
}
}
}

var countryById = this.countrySearch(countriesSubscription, function(key){
return key.CountryId === 1;
})
console.log(countryById);

var countryByName = this.countrySearch(countriesSubscription, function(key){
return key.CountryName === "Australia";
})
console.log(countryByName);

var CountryBySubscribtion = this.countrySearch(countriesSubscription, s => s.IsSubscribed === false )
console.log(CountryBySubscribtion.CountryName);
}

abc(3);
Doing group by like in JavaScript using the reduce function, see:


var countriesSubscription = [
{ Exchange: 'ASX', CountryId: 1, ExchangeRate: 1, CountryName: "Australia", Code: "AU", CurrencyForeign: "AUD", CurrencyLocal: "AUD", IsSubscribed: true, PriceLocal: 15.75, PriceForeign: null, DataType: "ClickToRefresh" },
{ Exchange: 'ASX', CountryId: 2, ExchangeRate: 1.01, CountryName: "Canada", Code: "CAN", CurrencyForeign: "CAD", CurrencyLocal: "AUD", IsSubscribed: false, PriceLocal: null, PriceForeign: null, DataType: "" },
{ Exchange: 'ASX', CountryId: 3, ExchangeRate: 5.78, CountryName: "Hong Kong", Code: "HKG", CurrencyForeign: "HKD", CurrencyLocal: "AUD", IsSubscribed: false, PriceLocal: null, PriceForeign: null, DataType: "" },
{ Exchange: 'CHIX', CountryId: 4, ExchangeRate: 0.74, CountryName: "US", Code: "USA", CurrencyForeign: "USD", CurrencyLocal: "AUD", IsSubscribed: true, PriceLocal: null, PriceForeign: null, DataType: "" },
{ Exchange: 'ASX', CountryId: 5, ExchangeRate: 0.67, CountryName: "France", Code: "FRA", CurrencyForeign: "EUR", CurrencyLocal: "AUD", IsSubscribed: false, PriceLocal: null, PriceForeign: null, DataType: "" },
{ Exchange: 'CHIX', CountryId: 6, ExchangeRate: 1.37, CountryName: "Switzerland", Code: "CHE", CurrencyForeign: "CHF", CurrencyLocal: "AUD", IsSubscribed: true, PriceLocal: null, PriceForeign: null, DataType: "" },
{ Exchange: 'ASX', CountryId: 7, ExchangeRate: 0.73, CountryName: "Belgium", Code: "BEL", CurrencyForeign: "EUR", CurrencyLocal: "AUD", IsSubscribed: false, PriceLocal: null, PriceForeign: null, DataType: "" },
];


// **** Array to group by Exchange ****
var groupByCurrency = countriesSubscription.reduce(function(all, item, index){
all[item.Exchange].push(item);
return all;
}, {CHIX:[], ASX:[]});

groupByCurrency.ASX.forEach(function(item){
console.log(item);
})

groupByCurrency.CHIX.forEach(function(item){
console.log(item);
})


output:

CountryId: 5, ExchangeRate: 0.67, CountryName: 'France', Code: 'FRA', CurrencyForeign: 'EUR', CurrencyLocal: 'AUD', IsSubscribed: false, PriceLocal: null, PriceForeign: null, DataType: '' } { Exchange: 'ASX', CountryId: 7, ExchangeRate: 0.73, CountryName: 'Belgium', Code: 'BEL', CurrencyForeign: 'EUR', CurrencyLocal: 'AUD', IsSubscribed: false, PriceLocal: null, PriceForeign: null, DataType: '' }

{ Exchange: 'CHIX', CountryId: 4, ExchangeRate: 0.74, CountryName: 'US', Code: 'USA', CurrencyForeign: 'USD', CurrencyLocal: 'AUD', IsSubscribed: true, PriceLocal: null, PriceForeign: null, DataType: '' } { Exchange: 'CHIX', CountryId: 6, ExchangeRate: 1.37, CountryName: 'Switzerland', Code: 'CHE', CurrencyForeign: 'CHF', CurrencyLocal: 'AUD', IsSubscribed: true, PriceLocal: null, PriceForeign: null, DataType: '' }  

Tuesday, May 16, 2017

Monday, May 15, 2017

Redis client

https://www.codeproject.com/Articles/636730/Distributed-Caching-using-Redis

. Net free code profiler

https://channel9.msdn.com/coding4fun/blog/Keeping-Track-of-Your-Codes-Preformance-with-CodeTrack

Gui windlg dump file debug

https://channel9.msdn.com/coding4fun/blog/Keeping-Track-of-Your-Codes-Preformance-with-CodeTrack

Thursday, May 11, 2017

Chrome extension c#

https://www.codeproject.com/Articles/1185723/Develop-Your-First-Google-Chrome-Extension-Using-H

Monday, May 8, 2017

Encription library as in ravebdb

http://feedproxy.google.com/~r/AyendeRahien/~3/TZJP-64f4FI/ravendb-4-0-full-database-encryption

Thursday, April 27, 2017

Wednesday, April 26, 2017

Monday, April 17, 2017

Alternative to SmtpClient

http://www.infoq.com/news/2017/04/MailKit-MimeKit-Official?utm_campaign=infoq_content&utm_source=infoq&utm_medium=feed&utm_term=.NET

Monday, February 27, 2017

Filter array javascript

http://stackoverflow.com/questions/31831651/javascript-filter-array-multiple-conditions

Friday, February 3, 2017

Edit fiddle - JSFiddle

Edit fiddle - JSFiddle



Simple HTML table with template and jquery will populate the template with data ...

Dynamically Add and Remove rows in a Table Using jquery - JS Tutorials

Dynamically Add and Remove rows in a Table Using jquery - JS Tutorials

Bootstrap Snippet Dynamic Table row creation and Deletion using HTML Bootstrap jQuery | Bootsnipp.com

Bootstrap Snippet Dynamic Table row creation and Deletion using HTML Bootstrap jQuery | Bootsnipp.com

EditableGrid, build powerful editable tables - What's EditableGrid ?

EditableGrid, build powerful editable tables - What's EditableGrid ?





another javascript grid

Responsive Bootstrap Table

Responsive Bootstrap Table





javascript grid - table - good one?

Manage Javascript Sourced Data

Manage Javascript Sourced Data

DataTables example - Form inputs

DataTables example - Form inputs

Roslynator Refactorings - Visual Studio Marketplace

Roslynator Refactorings - Visual Studio Marketplace



free refactoring tool ...

DataTables example - Javascript sourced data

DataTables example - Javascript sourced data



javascript grid!

ReAttach - Visual Studio Marketplace

ReAttach - Visual Studio Marketplace







VS extension that remembers the last debugging session and reattaches to it e.g IIS Worker process.

Thursday, January 19, 2017

Conditional check constraints

http://dpatrickcaldwell.blogspot.com.au/2009/05/conditional-check-constraints-on-sql.html?m=1