Using NBGV to tag your master branch on push.
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; | |
using System.IdentityModel.Tokens.Jwt; | |
using Microsoft.IdentityModel.Tokens; | |
using System.Text; | |
public class JwtTokenGenerator | |
{ | |
public string CreateZendeskJwtToken(string zendeskSecret, string keyId, string userName, string userEmail, string externalId) | |
{ | |
var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(zendeskSecret)); |
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
var port = 4539; | |
var client = new System.Net.Sockets.UdpClient(); | |
var ip = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("10.0.104.255"), port); | |
var bytes = System.Text.Encoding.ASCII.GetBytes("HelpINeedDatabaseConfigPlease🫡🫡"); | |
_ = client.Send(bytes, bytes.Length, ip); | |
var result = await client.ReceiveAsync(); |
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 MongoDB.Bson; | |
using MongoDB.Driver; | |
using Serilog; | |
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Mongo |
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; | |
public class Program | |
{ | |
public static int[] Reverse(int[] values) | |
{ | |
int N = values.Length; | |
for (var i = 0; i < N; i++) | |
{ | |
values[i] = values[N-i]; |
(C) 2015 by Derek Hunziker, (C) 2017 by AppsOn
As of releasing MongoDB 3.4 and C# Driver v2.4, original cheatsheet by Derek is outdated. In addition, it has some deficiencies like connecting to MongoDB, creating indexes, etc. This updated version works fine with C# Driver v2.4.7 and MongoDB v3.4.
Note: Defined models and collections will be used in entire cheatsheet.
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; | |
using System.Collections.Generic; | |
using System.Threading; | |
using System.Threading.Channels; | |
using System.Threading.Tasks; | |
namespace Test | |
{ | |
public class AsyncProgress<T> : IProgress<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
module Kalkis | |
open System.Threading.Tasks | |
type Operation = Add | Sub | Mul | Div | Pow | |
and Calculator = | |
| Value of double | |
| Expr of Operation * Calculator * Calculator |
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
package main | |
import ( | |
"math/rand" | |
"fmt" | |
"time" | |
"strings" | |
"net/http" | |
) | |
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" |
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; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Globalization; | |
using System.IO; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Reactive.Linq; | |
using System.Text; | |
using System.Threading; |
NewerOlder