Added app settings in the web job.
DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER
to false.
Thursday, 26 March 2020
Tuesday, 16 July 2019
Retrieve or set function app version on Azure
$funcName = "function-name-func"
$resourceGroup = "resource-groupname-rg"
$funcVersion = "~1"
az functionapp config appsettings list --name $funcName --resource-group $resourceGroup --query "[?name=='FUNCTIONS_EXTENSION_VERSION'].value"
or
az functionapp config appsettings set --name $funcName --resource-group $resourceGroup --settings FUNCTIONS_EXTENSION_VERSION=$funcVersion
Tuesday, 25 April 2017
Format pound and pence currency javascript
function formatCurrency(num) {function CheckNumeric() {
num = num.toString().replace(/\$|\,/g, '');
if (isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num * 100 + 0.50000000001);
pence = num % 100;
num = Math.floor(num / 100).toString();
if (pence < 10)
pence = "0" + pence;
for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3) ; i++)
num = num.substring(0, num.length - (4 * i + 3)) + ',' + num.substring(num.length - (4 * i + 3));
return (((sign) ? '' : '-') + '£' + num + '.' + pence);
}
return event.keyCode > 47 && event.keyCode < 58 || event.keyCode == 46;
}
function FormatOtherAmount() {
var anotherAmount = document.getElementById('mainContent_txtOtherAmount');
document.getElementById('mainContent_txtOtherAmount').value = formatCurrency(anotherAmount.value);
}
Tuesday, 12 April 2016
Octopus production config transformation
Additional transforms
Web.Release.config => Web.config
*.Production.config => *.config
Friday, 30 January 2015
You may receive an error message when you try to run an existing CLR object or create an assembly that has the external_access or unsafe permission set on a database that is attached or restored from a different server
USEGO ALTER DATABASE SET TRUSTWORTHY ON EXEC sp_changedbowner 'sa'
http://support.microsoft.com/kb/918040
Friday, 26 December 2014
Wednesday, 19 November 2014
MongoDB: Update a field in collection
db.foo.update({filter
db.foo.update({Title: "Test"}, {$set: {PublishedTime: new ISODate("2014-11-19T16:29:00Z")}}, { multi: true })
Friday, 31 October 2014
Change computer name on Ubuntu
1.Edit /etc/hostname, make the name change, save the file.
2.You should also make the same changes in /etc/hosts file
3. Run sudo /etc/init.d/hostname restart or sudo service hostname restart
http://askubuntu.com/a/16443
2.You should also make the same changes in /etc/hosts file
3. Run sudo /etc/init.d/hostname restart or sudo service hostname restart
http://askubuntu.com/a/16443
SSH root login permit
sudo -i
sudo passwd root
2. Find the line PermitRootLogin no and change it to PermitRootLogin yes.
3. Restart the ssh service by sudo /etc/init.d/ssh restart or sudo service ssh restart
http://askubuntu.com/questions/372380/remote-ssh-root-login-with-ubuntu-12-04
Tuesday, 30 September 2014
Visual Studio Copy Content Linked Files
https://www.nuget.org/packages/MSBuild.WebApplication.CopyContentLinkedFiles/
Friday, 5 September 2014
TinyMCE Turkish character problem
http://stackoverflow.com/questions/20814377/tinymce-utf-8-saving-to-mysql-database
Wednesday, 23 July 2014
How to pass an array of integers to a asp.net web api rest service?
public IEnumerable GetCategories([ModelBinder(typeof(CommaDelimitedArrayModelBinder))]long[] categoryIds)
{
// do your thing
}
public class CommaDelimitedArrayModelBinder : IModelBinder
{
public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext)
{
var key = bindingContext.ModelName;
var val = bindingContext.ValueProvider.GetValue(key);
if (val != null)
{
var s = val.AttemptedValue;
if (s != null)
{
var elementType = bindingContext.ModelType.GetElementType();
var converter = TypeDescriptor.GetConverter(elementType);
var values =
s.Split(new[] {","}, StringSplitOptions.RemoveEmptyEntries)
.Select(converter.ConvertFromString).ToArray();
var typedValues = Array.CreateInstance(elementType, values.Length);
values.CopyTo(typedValues, 0);
bindingContext.Model = typedValues;
}
else
{
// change this line to null if you prefer nulls to empty arrays
bindingContext.Model = Array.CreateInstance(bindingContext.ModelType.GetElementType(), 0);
}
return true;
}
return false;
}
}
http://stackoverflow.com/a/19107738/1436831
{
// do your thing
}
public class CommaDelimitedArrayModelBinder : IModelBinder
{
public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext)
{
var key = bindingContext.ModelName;
var val = bindingContext.ValueProvider.GetValue(key);
if (val != null)
{
var s = val.AttemptedValue;
if (s != null)
{
var elementType = bindingContext.ModelType.GetElementType();
var converter = TypeDescriptor.GetConverter(elementType);
var values =
s.Split(new[] {","}, StringSplitOptions.RemoveEmptyEntries)
.Select(converter.ConvertFromString).ToArray();
var typedValues = Array.CreateInstance(elementType, values.Length);
values.CopyTo(typedValues, 0);
bindingContext.Model = typedValues;
}
else
{
// change this line to null if you prefer nulls to empty arrays
bindingContext.Model = Array.CreateInstance(bindingContext.ModelType.GetElementType(), 0);
}
return true;
}
return false;
}
}
http://stackoverflow.com/a/19107738/1436831
MongoDB Install as a Windows Service
Create a MongoDB config file as a filename like mongod.cfg
logpath=c:\data\log\mongod.log
dbpath=c:\data\db
In Cmd: sc.exe create MongoDB binPath= "\"C:\Program Files\MongoDB 2.6 Standard\bin\mongod.exe\" --service --config=\"C:\Program Files\MongoDB 2.6 Standard\mongod.cfg\"" DisplayName= "MongoDB 2.6 Standard" start= "auto"
In Cmd: sc.exe create MongoDB binPath= "\"C:\Program Files\MongoDB 2.6 Standard\bin\mongod.exe\" --service --config=\"C:\Program Files\MongoDB 2.6 Standard\mongod.cfg\"" DisplayName= "MongoDB 2.6 Standard" start= "auto"
Wednesday, 30 April 2014
Thursday, 10 April 2014
Windows ASP.NET : %1 is not a valid Win32 application Hatası
http://www.sekman.net/windows-asp-net-1-is-not-a-valid-win32-application-hatasi.html
Monday, 8 July 2013
Fixing the IE 8 warning
Going to Tools->Internet Options->Security
Select the Security tab
Click on the Internet zone icon at the top of the tab page
Click the Custom Level button
In the Miscellaneous section change Display mixed content to Enable
Repeat steps 1 – 5 for the Local intranet and Trusted sites zones
http://blog.httpwatch.com/2009/04/23/fixing-the-ie-8-warning-do-you-want-to-view-only-the-webpage-content-that-was-delivered-securely/
Thursday, 11 April 2013
IE 8 & IE9 CORS Access Denied problem
https://github.com/jaubourg/ajaxHooks/blob/master/src/xdr.js
http://stackoverflow.com/questions/5250256/inconsistent-ajax-xdr-response-from-ie
https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest/blob/8754607e5f9ab73ccc37246f0c12fed14f85bd28/jQuery.XDomainRequest.js
setTimeout(function () {
xdr.send( ( s.hasContent && s.data ) || null );
}, 0);
Wednesday, 10 April 2013
Subscribe to:
Posts (Atom)
