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
| # JSON. | |
| import json | |
| with open('test.json', 'r') as f: | |
| data = json.load(f) | |
| print(data) |
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
| # Text File. | |
| with open('test.txt', 'r') as f: | |
| data = f.readlines() | |
| print(data) |
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
| /// <summary> | |
| /// Initialize NLog settings. Mainly for Slack sync use. | |
| /// </summary> | |
| private void InitializeNlog() | |
| { | |
| var slackWebHookUrl = AppSettings["NLogToSlackWebHookUrl"]; | |
| if (string.IsNullOrWhiteSpace(slackWebHookUrl)) | |
| { | |
| return; |
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.Security.Cryptography.X509Certificates; | |
| using System.Security.Cryptography; | |
| var abyPublicKey = AssemblyUtility.GetEmbeddedFileAsByteArray("WebServer.SslCertificate.cer"); | |
| var abyPrivateKey = AssemblyUtility.GetEmbeddedFileAsByteArray("WebServer.SslCertificate.pvk"); | |
| var certificate = new X509Certificate2(abyPublicKey, string.Empty, | |
| X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable); | |
| var cspParams = new CspParameters | |
| { |
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 Dapper; | |
| using Oracle.ManagedDataAccess.Client; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Data; | |
| using System.Linq; | |
| public class OracleDynamicParameters : Dapper.SqlMapper.IDynamicParameters { | |
| private static Dictionary<SqlMapper.Identity, Action<IDbCommand, object>> paramReaderCache = new Dictionary<SqlMapper.Identity, Action<IDbCommand, object>>( ); |
NewerOlder