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
let (|TakeUntil|_|) x xs = | |
match List.takeWhile ((<>) x) xs with | |
| y when y = xs -> None | |
| y -> Some(y, List.skipWhile ((<>) x) xs) | |
let (|Split|_|) split xs = | |
match xs with | |
| TakeUntil split (x1, (_ :: x2)) -> Some(x1, x2) | |
| _ -> None |
We recently had to provide (near) live data to a set of views in our application. After considering the most common ways to build this we decided to go with long polling. Our entire app is event based, so we know if a certain event happed the data might have changed. Lets assume the following types represent what can happen in our application:
type CounterEvent =
| CounterWasIncremented byValue: int
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
internal class DockerMsSqlServerDatabase : IAsyncDisposable | |
{ | |
private const string Password = "!Passw0rd"; | |
private const string Image = "mcr.microsoft.com/mssql/server"; | |
private const string Tag = "2019-GA-ubuntu-16.04"; | |
private static IContainer _sqlServerContainer; | |
private SemaphoreSlim semaphore = new(1, 1); | |
private readonly string DatabaseName; |
Thanks to Sergey Tihon for running F# Weekly and F# Advent.
Thanks to manofstick for trying out the code and coming with invaluable feedback. Cistern.ValueLinq is very impressive.
There were many interesting improvements in F#6 but one in particular caught my eye, the attribute InlineIfLambda
.
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
<div x-data="{ openTab: 1 }" class="flex flex-col-reverse"> | |
<div class="hidden mt-6 w-full max-w-2xl mx-auto sm:block lg:max-w-none"> | |
<div class="grid grid-cols-4 gap-6" aria-orientation="horizontal" role="tablist"> | |
@foreach ($product->productImages as $productImage) | |
<button x-on:click="{ openTab = {{ $loop->iteration }} }" id="tabs-1-tab-{{ $loop->iteration }}" | |
class="relative h-24 bg-white rounded-md flex items-center justify-center text-sm font-medium uppercase text-gray-900 cursor-pointer hover:bg-gray-50 focus:outline-none focus:ring focus:ring-offset-4 focus:ring-opacity-50" | |
aria-controls="tabs-1-panel-{{ $loop->iteration }}" | |
:tabindex="openTab === {{ $loop->iteration }} ? 0 : -1" | |
:aria-selected="openTab === {{ $loop->iteration }} ? 'true' : 'false'" | |
role="tab" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 FullCalendar from '@fullcalendar/react'; | |
import dayGridPlugin from '@fullcalendar/daygrid'; | |
import timeGridPlugin from '@fullcalendar/timegrid'; | |
import interactionPlugin from '@fullcalendar/interaction'; | |
const events = [ | |
{ | |
id: 1, | |
title: 'event 1', | |
start: '2021-06-14T10:00:00', |
NewerOlder