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 interface ILogger | |
{ | |
void Log(string message); | |
} | |
public class ConsoleLogger : ILogger | |
{ | |
public void Log(string message) | |
{ | |
Console.WriteLine(message); |
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
[Fact] | |
public void IsPrime_InputIs1_ReturnFalse() | |
{ | |
var primeService = new PrimeService(); | |
bool result = primeService.IsPrime(1); | |
Assert.False(result, "1 should not be prime"); | |
} |
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 decimal ConvertStringNumberToDecimal(string importTransac) | |
{ | |
CultureInfo enUS = new CultureInfo("en-US"); | |
CultureInfo esAR = new CultureInfo("es-AR"); | |
CultureInfo originalCulture = CultureInfo.CurrentCulture; | |
decimal importe; | |
decimal parse; | |
System.Threading.Thread.CurrentThread.CurrentCulture = enUS; |
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
<system.webServer> | |
<httpProtocol> | |
<customHeaders> | |
<add name="Access-Control-Allow-Origin" value="*" /> | |
<add name="Access-Control-Allow-Headers" value="Accept,Content-Type,X-Requested-With" /> | |
</customHeaders> | |
</httpProtocol> | |
</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
//function to open pages in a dialog | |
function openInDialog(dlgWidth, dlgHeight, dlgAllowMaximize,dlgShowClose,needCallbackFunction, pageUrl) | |
{ | |
var options = { url: pageUrl, width: dlgWidth, height: dlgHeight, allowMaximize: dlgAllowMaximize, | |
showClose: dlgShowClose | |
}; | |
if(needCallbackFunction) | |
{ | |
options.dialogReturnValueCallback = Function.createDelegate(null, CloseDialogCallback); |
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
.ui-tabs-nav { | |
margin: 0; | |
padding: 0; | |
} | |
.ui-tabs-nav li { | |
list-style: none; | |
margin: 0 1px 0 0; | |
padding: 0; | |
float: left; | |
} |
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
//Here is an example: | |
string fileName = "Test/"; | |
fileName= fileName.TrimEnd(new[] { '/' }); | |
//With this method you can also specify multiple characters so you may want to remove all slash or backslash using the array. | |
string fileName = "Test\\"; | |
fileName= fileName.TrimEnd(new[] { '/', '\\' }); |
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
int loop1, loop2; | |
// Load ServerVariable collection into NameValueCollection object. | |
var coll = Request.ServerVariables; | |
// Get names of all keys into a string array. | |
String[] arr1 = coll.AllKeys; | |
for (loop1 = 0; loop1 < arr1.Length; loop1++) | |
{ | |
Response.Write("Key: " + arr1[loop1] + "<br>"); | |
String[] arr2 = coll.GetValues(arr1[loop1]); |
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
<Query> | |
<Where> | |
<And> | |
<Geq> | |
<FieldRef Name="StartDate" /> | |
<Value IncludeTimeValue="TRUE" Type="DateTime">2011-01-01T15:55:52Z</Value> | |
</Geq> | |
<Leq> | |
<FieldRef Name="StartDate" /> | |
<Value IncludeTimeValue="TRUE" Type="DateTime">2011-12-31T15:56:29Z</Value> |
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 myList = [ | |
{"id": 1, "sortOrder": 4}, | |
{"id": 2, "sortOrder": 2}, | |
{"id": 3, "sortOrder": 3}, | |
{"id": 4, "sortOrder": 1} | |
]; | |
myList = sortByKey(myList, "sortOrder"); | |
function sortByKey(array, key) { |
NewerOlder