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
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Default%20Settings] | |
"Colour0"="248,248,242" | |
"Colour1"="248,248,242" | |
"Colour2"="39,40,34" | |
"Colour3"="39,40,34" | |
"Colour4"="0,0,0" | |
"Colour5"="255,128,0" | |
"Colour6"="0,0,0" |
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
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace AsyncAndAwaitSecrets.Mistakes | |
{ | |
public interface IDependency<T> | |
{ | |
Task<object> BeforeAsync(); |
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
using System.Threading.Tasks; | |
namespace AsyncAndAwaitSecrets.Samples | |
{ | |
public class AsyncAndAwait<T> | |
{ | |
private readonly IDependency<T> _dependency; | |
public AsyncAndAwait(IDependency<T> dependency) | |
{ |
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
using System; | |
using System.Threading.Tasks; | |
namespace AsyncAndAwaitSecrets.Samples | |
{ | |
public interface IAsynchronousProgrammingModel<T> | |
{ | |
IAsyncResult BeginSomething(AsyncCallback callback, object state); | |
T EndSomething(IAsyncResult result); |
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
import requests | |
import json | |
GITHUB_API = 'https://api.github.com/' | |
ORG = "<your-org>" | |
AUTH = ('<your-personal-access-token>', '') | |
class GitHubTeam: | |
_ids_by_name = {} |
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
class Program | |
{ | |
private const int CallsToMake = 100; | |
private const string UrlToCall = "http://www.pudim.com.br"; | |
static void Main(string[] args) | |
{ | |
Time(DisposingHttpClient, "Disposal of HttpClient instance"); | |
Time(ReusingHttpClient, "Reuse of HttpClient instance"); | |
} |
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 static class HttpMessageHandlerExtensions | |
{ | |
public static HttpMessageHandler ThatRespondsWithAnEmptyContent(this HttpMessageHandler handler) | |
{ | |
var mock = Mock.Get(handler); | |
var responseWithAnEmptyContent = new HttpResponseMessage {Content = new StringContent(string.Empty)}; | |
mock.Protected() | |
.Setup<Task<HttpResponseMessage>>("SendAsync", new object[] | |
{ |
NewerOlder