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
public Message Post([FromBody]Message message) | |
{ | |
const string NotSupportMessage = "Sorry, I could not understand that."; | |
if (message.Type == "Message") | |
{ | |
Command command = null; | |
if (Command.TryParse(message.Text, out command) == false) | |
{ | |
return message.CreateReplyMessage(NotSupportMessage); |
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
private static Message CreateReplyMessage(Message message, string text) | |
{ | |
var reply = message.CreateReplyMessage(text); | |
reply.BotUserData = message.BotUserData; | |
return reply; | |
} | |
private Message HandleAddCommand(Command command, Message message) | |
{ |
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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
!-:: | |
{ | |
SendInput — | |
} | |
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; | |
using System.Security.Cryptography; | |
using System.Text; | |
using Microsoft.AspNetCore.DataProtection; | |
namespace Home.Web | |
{ | |
internal sealed class HmacDataProtector : IDataProtector | |
{ | |
private const int HmacSize = 32; // for SHA256 |
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
version: '3' | |
services: | |
web: | |
image: microsoft/dotnet:1.1.1-sdk | |
ports: | |
- "5000:5000" | |
env_file: .env | |
depends_on: | |
- db | |
volumes: |
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
FROM microsoft/dotnet:1.1.1-runtime | |
RUN mkdir /opt/app-release | |
WORKDIR /opt/app-release | |
COPY out . | |
ENTRYPOINT ["dotnet", "My.Dotnet.Application.dll"] |
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
private static IWebHost CreateWebHost() | |
{ | |
var scheme = Environment.GetEnvironmentVariable("SCHEME"); | |
if (string.IsNullOrWhiteSpace(scheme)) | |
{ | |
scheme = "http"; | |
} | |
var port = Environment.GetEnvironmentVariable("PORT"); | |
if (string.IsNullOrWhiteSpace(port)) |
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
type FileInfo* = object |
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
def fib(i : Int32, ch : Channel(Int32) | Nil) | |
if i < 2 | |
return i if ch.nil? | |
ch.send(i) | |
return 0 | |
end | |
sub_ch = Channel(Int32).new | |
spawn fib(i - 1, sub_ch) | |
x = fib(i - 2, nil) |
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
"use strict"; | |
class Test_Location { | |
get name() { | |
return this._name; | |
} | |
set name(val) { | |
if (val === null || val === undefined) { | |
throw "Cannot set null or undefined value for 'name'"; |