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
-- Logs begin at Thu 2020-02-20 21:03:22 UTC. -- | |
Mar 25 18:54:47 srv-pro-schd-05 consul[30217]: 2020-03-25T18:54:47.382Z [DEBUG] agent.server.autopilot: Failed to remove dead servers: error="denied, because removing the majority of servers 1/1 is not safe" | |
Mar 25 18:54:57 srv-pro-schd-05 consul[30217]: 2020-03-25T18:54:57.382Z [DEBUG] agent.server.autopilot: Failed to remove dead servers: error="denied, because removing the majority of servers 1/1 is not safe" | |
Mar 25 18:55:06 srv-pro-schd-05 consul[30217]: 2020-03-25T18:55:06.607Z [DEBUG] agent: Skipping remote check since it is managed automatically: check=serfHealth | |
Mar 25 18:55:06 srv-pro-schd-05 consul[30217]: 2020-03-25T18:55:06.608Z [DEBUG] agent: Node info in sync | |
Mar 25 18:55:07 srv-pro-schd-05 consul[30217]: 2020-03-25T18:55:07.361Z [DEBUG] agent.server: Skipping self join check for node since the cluster is too small: node=srv-pro-svrg-01 | |
Mar 25 18:55:07 srv-pro-schd-05 consul[30217]: 2020-03-25T18:55:07.382Z [DEBUG] agent.se |
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
WITH dates AS ( | |
SELECT | |
date_trunc('day', dd):: date AS date | |
FROM generate_series | |
('2017-01-01'::timestamp | |
, @currentDate::timestamp | |
, '1 day'::interval) dd | |
), | |
quarters AS ( |
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
internal static class FormsAuthenticationTicketHelper | |
{ | |
private const byte CURRENT_TICKET_SERIALIZED_VERSION = 0x01; | |
private const int MAX_TICKET_LENGTH = 4096; | |
// Resurrects a FormsAuthenticationTicket from its serialized blob representation. | |
// The input blob must be unsigned and unencrypted. This function returns null if | |
// the serialized ticket format is invalid. The caller must also verify that the | |
// ticket is still valid, as this method doesn't check expiration. |
The goal of this is to have an easily-scannable reference for the most common syntax idioms in C# and Rust so that programmers most comfortable with C# can quickly get through the syntax differences and feel like they could read and write basic Rust programs.
What do you think? Does this meet its goal? If not, why not?
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
## General Stuff | |
### List of all tables | |
SELECT * FROM pg_catalog.pg_tables | |
### Create new user and give it superuser access | |
create user adminuser createuser password '1234Admin'; | |
alter user adminuser createuser; | |
### Create user without superuser privilege |
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
Log.Logger = new LoggerConfiguration() | |
.MinimumLevel.Debug() | |
.Destructure.ByTransforming<ExpandoObject>(JsonConvert.SerializeObject) | |
.WriteTo.AzureAnalytics( | |
workspaceId: Configuration["AZUREANALYTICS_WORKSPACEID"], | |
authenticationId: Configuration["AZUREANALYTICS_AUTHENTICATIONID"], | |
logName: "logTableName", | |
restrictedToMinimumLevel: LogEventLevel.Debug, | |
batchSize: 10) | |
.CreateLogger(); |
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 IActionResult WarehouseTransactions() | |
{ | |
dynamic logs = new ExpandoObject(); | |
try | |
{ | |
using (var athenaDb = LocalDB.GetConnection()) | |
using (var remoteDb = RemoteDB.GetConnection()) | |
{ | |
//download ids+lastmodified timestamp for source and destination | |
var sourceTransationState = athenaDb |
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.Linq; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using Microsoft.AspNetCore.Routing; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
namespace GithubPullerDemo | |
{ | |
public class GitHubRepo |
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
static class Program | |
{ | |
public static IConfigurationRoot Configuration { get; } | |
public static ILoggerFactory LoggerFactory { get; } | |
public static DbConnectionStringBuilder DbConnectionStringBuilder { get; } | |
static Program() | |
{ | |
Configuration = new ConfigurationBuilder() | |
.AddEnvironmentVariables("TROICENETDEV_") | |
.Build(); |
NewerOlder