This file contains hidden or 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
customMatchers = | |
toBeLowerCase: (util) -> | |
return compare: (actual) -> | |
result = new Object | |
result.pass = util.equals(actual, actual.toLowerCase()) | |
result.message = if result.pass then "okay" else "Expected '" + actual + "' to be lower case" | |
return result | |
describe "customMatchers", () -> | |
beforeEach () -> |
This file contains hidden or 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
# http://eclipsesource.com/blogs/2014/03/27/mocks-in-jasmine-tests/ | |
window.mock = (constr, name) -> | |
keys = [] | |
console.log "!" + constr.prototype.length | |
for key in constr.prototype | |
keys.push key | |
if keys.length > 0 | |
return jasmine.createSpyObj(name || "mock", keys) | |
else |
This file contains hidden or 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
rem SET Platform = %2 | |
IF "%2" == "" ( | |
REM Note spacing either side of equals is important (don't have it!) | |
SET Platform=Any CPU | |
) | |
echo 1: %1 | |
echo 2: %2 | |
echo 3: %Platform% |
This file contains hidden or 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
Update-ExecutionPolicy Unrestricted | |
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar | |
cinst -y notepadplusplus | |
cinst -y brackets | |
cinst -y dotpeek | |
cinst -y soapui | |
cinst -y fiddler4 |
This file contains hidden or 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.Security.Cryptography; | |
using System.Text; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine(EncodePassword("Pa55w0rd")); | |
} |
This file contains hidden or 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 U IfNotNull < T, U > (this T t, Func <T, U> function) | |
{ | |
return t != null ? function (t) : default (U); | |
} |
This file contains hidden or 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
// http://dotnetfiddle.net/wBqZSX | |
using System; | |
using System.Text; | |
using System.Security.Cryptography; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine(EncodePassword("Pa55w0rd", "Gr6NjoLK1t89g4pwjmfC1g==")); |
This file contains hidden or 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 getAgeNextBirthday(dateOfBirth, asOfDate) { | |
var dateOfBirthyyyymmdd = dateOfBirth.getFullYear().toString() + ('0'+(dateOfBirth.getMonth() + 1).toString()).slice(-2) + ('0'+dateOfBirth.getDate().toString()).slice(-2); | |
var asOfDateyyyymmdd = asOfDate.getFullYear().toString() + ('0'+(asOfDate.getMonth() + 1).toString()).slice(-2) + ('0',asOfDate.getDate().toString()).slice(-2); | |
return Math.floor((asOfDateyyyymmdd - dateOfBirthyyyymmdd) / 10000) + 1; | |
} |
This file contains hidden or 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 Function GetAgeNextBirthday(ByVal dateOfBirth As Date, ByVal asOfDate As Date) As Integer | |
Dim dateOfBirthmmdd As Integer = Format(dateOfBirth, "yyyyMMdd") | |
Dim asOfDatemmdd As Integer = Format(asOfDate, "yyyyMMdd") | |
GetAgeNextBirthday = ((asOfDatemmdd - dateOfBirthmmdd) / 10000) + 1 | |
End Function |
This file contains hidden or 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 c = int.TryParse("1", out c) ? c : 0; |
NewerOlder