Skip to content

Instantly share code, notes, and snippets.

module PackagesPolicy
#r "paket:
nuget FSharp.Core
nuget Fake.Core.Process
nuget Fake.DotNet.Cli
"
open System.Text.RegularExpressions
open Fake.Core
@orient-man
orient-man / FindOutdatedPackages.fsx
Last active April 30, 2020 20:34
Check exit code!
module OutdatedPackages
#r "paket:
nuget FSharp.Core
nuget Fake.Core.Process
"
open Fake.Core
open System.Text.RegularExpressions
module Giraffe.ApplicationInsights
open Giraffe
open Microsoft.ApplicationInsights.DataContracts
let private setRoutingMetadata action : HttpHandler =
fun next ctx ->
let action' = ctx.Request.Method + " " + action
ctx.Request.RouteValues.["controller"] <- "Giraffe"
ctx.Request.RouteValues.["action"] <- action'
type Input = A of int | B of int | C of int
type Output = { A: int; B: int; C: int; Text: string }
seq {
yield (A 5, B 10), "text 1"
yield (B 5, C 10), "text 2"
yield (A 5, C 10), "text 3"
}
|> Seq.map (function
| (A a, B b), text -> { A = a; B = b; C = a * b; Text = text }
@orient-man
orient-man / NuGetHelper.fsx
Last active August 24, 2017 12:22
Appends pdb files to existing NuGet packages
module NuGetHelper
#r "../../../packages/FAKE/tools/FakeLib.dll"
#r "../../../packages/FAKE/tools/ICSharpCode.SharpZipLib.dll"
open System.IO
open Fake
let appendSymbolsToPackage outputDir configuration proj =
let fileInfo = proj |> FileInfo
let binDir = Path.Combine(fileInfo.DirectoryName, "bin/" + configuration)
let baseName = Path.GetFileNameWithoutExtension(fileInfo.Name)
<?xml version="1.0" encoding="utf-8"?>
<ServiceMetadataFiles>
<ServiceMetadataFile name="dluznik.xsd">
<xs:schema targetNamespace="http://bik.pl/cc/big" elementFormDefault="qualified" version="1.2.19.2" id="DLUZNIK-PLUS"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://bik.pl/cc/big">
<xs:element name="ig-dod" type="tns:TypIG">
<!--koment-->
<xs:annotation>
<xs:documentation>Struktura IG przekazywanej do InfoMonitor (ref. 6.1) - dodawanie</xs:documentation>
open System
open System.Collections.Generic
let tryGetValue (dict: IDictionary<_, _>) key = match dict.TryGetValue(key) with true, v -> Some v | _ -> None
let tryParseInt str = match Int32.TryParse(str) with true, v -> Some v | _ -> None
let calcSleepTime clock limitResetTime =
// https://support.sendgrid.com/hc/en-us/requests/1094766
// X-RateLimit-Reset = Unix timestamp = seconds since Jan 01 1970. (UTC)
let inline mergeWithDiff map1 map2 =
let keys map = map |> Map.toSeq |> Seq.map fst
let inline zeroIfNotFound key map =
map |> Map.tryFind key |> defaultArg <| LanguagePrimitives.GenericZero
Seq.append (map1 |> keys) (map2 |> keys)
|> Seq.distinct
|> Seq.map (fun key ->
let v1 = map1 |> zeroIfNotFound key
let v2 = map2 |> zeroIfNotFound key
key, (v1, v1 - v2))
  1. Potrzebne zbiory: ceny.btr, uslugi.btr i zmiany.mkd z Centrali

  2. Procedura importu jest zapisana jako test automatyczny w projecie Sprzefak.NET:

  • svn://192.168.20.105:3693/trunk/sprzefak.NET
  • svn://192.168.20.105:3693/trunk/sprzefak.NET/src/Sprzefak.Core.Test/ImporterUslugTests.cs
  1. Odpalenie testu:

a) Zmieniam stałą SkoroszytUslug na ścieżkę arkusza Excel zawierającego nowe usługi/ceny.

@orient-man
orient-man / diff.patch
Created February 25, 2015 14:06
DailyWTF
Index: C:/projekty/Pincasso.NET/src/Pincasso.Ckm.Core.Tests/Pincasso.Ckm.Core.Tests.csproj
===================================================================
--- C:/projekty/Pincasso.NET/src/Pincasso.Ckm.Core.Tests/Pincasso.Ckm.Core.Tests.csproj (wersja 39573)
+++ C:/projekty/Pincasso.NET/src/Pincasso.Ckm.Core.Tests/Pincasso.Ckm.Core.Tests.csproj (wersja 39574)
@@ -97,7 +97,6 @@
<Compile Include="Samples\SamplesDataEksportFaktur.cs" />
<Compile Include="SelfTests\BuildersTests.cs" />
<Compile Include="SetUpFixture.cs" />
- <Compile Include="Unit\DostepnoscDrukowaniaCkmServiceTests.cs" />
<Compile Include="Unit\ElementyPaczkiServiceTests.cs" />