Skip to content

Instantly share code, notes, and snippets.

View FrancescoBonizzi's full-sized avatar
🛰️
May the source be with you... ✨

Francesco Bonizzi FrancescoBonizzi

🛰️
May the source be with you... ✨
View GitHub Profile
var connectionFactory = new ConnectionFactory()
{
HostName = hostname,
UserName = username,
Password = password,
Port = port,
RequestedConnectionTimeout = 2000, // Milliseconds
};
return connectionFactory.CreateConnection();
private void ConnectOrFail(ITcpClient socket, AmqpTcpEndpoint endpoint, int timeout)
{
try
{
socket.ConnectAsync(endpoint.HostName, endpoint.Port)
.TimeoutAfter(timeout)
.ConfigureAwait(false)
.GetAwaiter().GetResult();
}
//...
#if CORECLR
await sock.ConnectAsync(ep, port).ConfigureAwait(false);
#else
sock.Connect(ep, port);
#endif
await Task.Run(() => sock.Connect(ep, port));
using Microsoft.Office.Interop.Excel;
using System;
using System.Runtime.InteropServices;
namespace ExcelToPdf
{
public class ExcelApplicationWrapper : IDisposable
{
public Application ExcelApplication { get; }
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
namespace ExcelToPdf
{
public class ExcelInteropExcelToPdfConverter
{
public void ConvertToPdf(IEnumerable<string> excelFilesPathToConvert)
{
using System;
using System.IO;
namespace ExcelToPdf
{
internal static class Program
{
private static void Main(string[] args)
{
string directoryWithExcelFiles;
.enlarging-title {
font-size: 30px;
color: black;
transition: all 0.3s ease;
}
.enlarging-title:hover {
font-size: 40px;
color: blue;
transition: all 0.3s ease;
.link {
animation: seek-attention 2s infinite;
font-size: 30px;
animation-play-state: running;
}
.link:hover {
animation-play-state: paused;
}
.astroboy {
display: block;
width: 151px;
height: 193px;
background: url('astroboy.png') left center;
animation: astroboy 0.8s steps(20) infinite;
}
.astroboy:hover {
animation-play-state: paused;