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
import Browser | |
import Html exposing (Html, button, div, text) | |
import Html.Events exposing (onClick) | |
type alias Flags = | |
{ counter : Int } | |
type Msg = Increment | Decrement | |
type Model = Model Int | |
init : Flags -> (Model, Cmd Msg) |
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
module Result = | |
let bind f = function | |
| Ok x -> f x | |
| Error x -> Error x | |
let map f = function | |
| Ok x -> Ok(f x) | |
| Error err -> Error err | |
let apply fResult xResult = |
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
module Main where | |
import Prelude | |
type Student = { | |
first :: String, | |
last :: String, | |
class :: String | |
} |
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
// Place your key bindings in this file to overwrite the defaults | |
[ | |
{ | |
"key": "ctrl+down", | |
"command": "editorScroll", | |
"args": { | |
"to": "down", | |
"by": "line", | |
"revealCursor": true | |
} |
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 class MessageChecksumConverter : PatternLayoutConverter | |
{ | |
private static readonly TraceSource Source = new TraceSource(nameof(MessageChecksumConverter)); | |
private static readonly MD5 ChecksumGenerator = MD5.Create(); | |
protected override void Convert(TextWriter writer, LoggingEvent loggingEvent) | |
{ | |
var output = TryGetHash(loggingEvent); | |
writer.Write(output); | |
} |
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
namespace Csp | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Decider.Csp.BaseTypes; | |
using Decider.Csp.Global; | |
using Decider.Csp.Integer; | |
public static class Program |
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
includeList = { | |
// put desired module names here | |
}; | |
skipList = {}; | |
handledList = {}; | |
handleModule(window.app); | |
function handleModule(module) { |
Define the operations being done by the application as discrete units of work. Examples: commands, queries, startup, shutdown. Define explicit boundaries between units of work. This makes it easy to log the operations of the application.
- Log startup scenario together with settings. I.e. read all settings at application startup, and only there.
- Log commands and queries. For commands, log command type and eventual return value. For queries, log the query type and the query result.
- Define a logging gateway with convenience methods for logging application events. Define a class that represents an application event and define all known application events in a single, static and application-specific, class. Application events are lower-level than business events. For example: ExecutingCommand, CommandResult, Starting, Started, ShuttingDown, BeginRequest, EndRequest.
- Application events should have their own event id.
- Build infrastructure layer that takes care of applicat
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 (var md5 = System.Security.Cryptography.MD5.Create()) | |
{ | |
var hash = md5.ComputeHash(Encoding.ASCII.GetBytes("[email protected]")); | |
var sb = new StringBuilder(); | |
for (int i = 0; i < hash.Length; i++) | |
{ | |
sb.Append(hash[i].ToString("x2")); | |
} |
NewerOlder