Skip to content

Instantly share code, notes, and snippets.

View adz's full-sized avatar

Adam Davies adz

  • Veridapt
  • Adelaide, Australia
  • 03:44 (UTC +09:30)
  • X @adzdavies28
View GitHub Profile
@adz
adz / capybara cheat sheet
Created March 2, 2023 00:06 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@adz
adz / build-fail2.log
Created February 21, 2020 03:28
Using framework 4.8 to try to build
C:\projects\FSharpPlus>fsi buildDocs.fsx
TARGET ---> CleanDocs
TARGET ---> Build
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 46.69 ms for C:\projects\FSharpPlus\src\FSharpPlus\FSharpPlus.fsproj.
@adz
adz / build-fail.log
Created February 21, 2020 03:09
dotnet fsi buildDocs.fsx
C:\projects\FSharpPlus (adz-document-generic-ops -> adz)
λ dotnet fsi buildDocs.fsx
TARGET ---> CleanDocs
TARGET ---> Build
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
@adz
adz / output.log
Created January 22, 2020 14:32
$ dotnet fake run build.fsx -t ReleaseDocs
Extracted Paket.Restore.targets to: /home/adam/projects/libs/FSharpPlus/.paket/Paket.Restore.targets (Can be disabled with PAKET_SKIP_RESTORE_TARGETS=true)
The last restore is still up to date. Nothing left to do.
run ReleaseDocs
Building project with version: LocalBuild
Shortened DependencyGraph for Target ReleaseDocs:
<== ReleaseDocs
<== All
<== BuildDocs
<== BuildPackage
<== CopyNuGet
@adz
adz / output.log
Created January 22, 2020 05:04
FSharpPlus build docs output: $ ./docsrc/tools/generate.sh
Processing help: /home/adam/projects/libs/FSharpPlus/docsrc/tools/../content/type-choicet.fsx
Processing help: /home/adam/projects/libs/FSharpPlus/docsrc/tools/../content/type-endo.fsx
Processing help: /home/adam/projects/libs/FSharpPlus/docsrc/tools/../content/abstraction-monoid.fsx
SourceError
((0, 0),(0, 0),Error,
"The type 'OptionalAttribute' is required here and is unavailable. You must add a reference to assembly 'System.Runtime.InteropServices, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.")
SourceError
((2, 0),(2, 6),Error,
"Unexpected keyword 'static' in definition. Expected incomplete structured construct at or before this point or other token.")
Processing help: /home/adam/projects/libs/FSharpPlus/docsrc/tools/../content/type-free.fsx
@adz
adz / AsyncRepeat.fs
Last active January 15, 2020 23:03
Background jobs recurring with delay
module Async
let delayBy (timespan : TimeSpan) a =
async {
do! Async.Sleep (Convert.ToInt32 timespan.TotalMilliseconds)
return! a
}
let rec repeat a =
async {
type Response = { StatusCode : int }
// Simulate sync action, that returns count of records synced
let syncRecords upToTimestamp = ResultT <| async.Return (Ok 3)
// Simulate bookmark function, sending last timestamp synced to a rest api
let recordTimestamp upToTimestamp = async {
return {StatusCode = 200 }
}
// Simulate sync action, that returns count of records synced
let syncRecords upToTimestamp : ResultT<Async<Result<int,string>>> = ResultT <| async.Return (Ok 3)
let recordTimestampUsingFSData body : Async<FSharp.Data.HttpResponse> =
FSharp.Data.Http.AsyncRequest
( "https://myapi.example.com/sync"
, httpMethod = "POST"
, body = TextRequest (sprintf "%A" body) // actually is json
, silentHttpErrors = true )
git
docker
docker-compose
asdf + java, ruby, node, elm, elixir
mono
java (gradle)
docker-sync
vim
janus-plugins
jetbrains intellij
@adz
adz / dryhints.rb
Last active January 24, 2017 03:55
# Schema looks like:
configure do
def iso8601?(input)
!(!Date.iso8601(input))
rescue ArgumentError
false
end
end
required(:position).filled(:int?)