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 async Task<string> Foo | |
{ | |
set | |
{ | |
} | |
get | |
{ | |
} | |
} |
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 class IFoo | |
{ | |
public object Current { get; set; } | |
public bool MoveNext() | |
{ | |
return whatever; | |
} | |
} | |
public class Bar |
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
'Make sure this import is at the top of the file: | |
Imports System.Globalization | |
'And the actual code: | |
Public Function ParseDateTime(ByVal dateTimeString As String) As DateTime? | |
Dim dt As DateTime | |
'Try to parse the date time... | |
If DateTime.TryParseExact(dateTimeString, New String() {"yyyyMMdd", "yyyy-MM-dd"}, CultureInfo.CurrentCulture, DateTimeStyles.None, dt) Then |
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
@AfterMethod(alwaysRun = true) | |
public void shutDownDriver(ITestResult result) throws IOException { | |
}@AfterMethod(alwaysRun = true) | |
public void shutDownDriver(ITestResult result) throws IOException { | |
// Update SauceLabs result | |
if(testbed.equals("saucelab")) { | |
String jobID = ((RemoteWebDriver)driver).getSessionId().toString(); | |
SauceREST client = new SauceREST("username", "key"); | |
Map<String, Object>sauceJob = new HashMap<String, Object>(); |
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
```java | |
@AfterMethod(alwaysRun = true) | |
public void shutDownDriver(ITestResult result) throws IOException { | |
}@AfterMethod(alwaysRun = true) | |
public void shutDownDriver(ITestResult result) throws IOException { | |
// Update SauceLabs result | |
if(testbed.equals("saucelab")) { | |
String jobID = ((RemoteWebDriver)driver).getSessionId().toString(); | |
SauceREST client = new SauceREST("username", "key"); |
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
OracleParameter paramString = new OracleParameter(); | |
paramString.Value = OracleString.Null; | |
var sizeStr = paramString.Size; //barf | |
OracleParameter paramBinary = new OracleParameter(); | |
paramBinary.Value = OracleBinary.Null; | |
var sizeBin = paramBinary.Size; //barf |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var foo = (MyType<string>) "cat"; | |
} | |
} | |
public class MyType<t> | |
{ |
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 (var timer = new System.Timers.Timer(2){AutoReset = false, Enabled = false}) | |
{ | |
using (var latch = new ManualResetEventSlim(false)) | |
{ | |
timer.Elapsed += (a, o) => latch.Set(); | |
timer.Start(); | |
latch.Wait(); | |
} | |
} |
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
ISession mySession = //Get your session object. | |
var myUsers = from user in mySession.Query<User>() where user.Name == "Kevin" select user; |
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 class RequireTargetProcessNumber : PreCommitHook | |
{ | |
protected override bool HandleHookEvent(ITransactionInfo commit) | |
{ | |
string commitMessage = commit.LogMessage; | |
if (!HasTargetProcessNumber(commitMessage)) | |
{ | |
this.Context.Output.WriteError("TargetProcess Number was not specified in commit message."); | |
return false; | |
} |