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
#r "nuget: GirCore.Gtk-4.0" | |
open Gtk | |
// https://mastodon.social/@lamg__/112546558109306665 | |
let label () = | |
let lb = new Label() | |
lb.SetText "Hello!" | |
lb |
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
open System.Threading.Tasks | |
open Npgsql.FSharp | |
open Npgsql | |
let connectionString : string = | |
Sql.host "myhome" | |
|> Sql.database "test_db" | |
|> Sql.username "test_user" | |
|> Sql.password "test123" | |
|> Sql.port 5432 |
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
see https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install | |
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh | |
chmod +x ./dotnet-install.sh | |
./dotnet-install.sh --version latest | |
/home/gitpod/.dotnet --version | |
/home/gitpod/.dotnet/dotnet clean | |
/home/gitpod/.dotnet/dotnet build |
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
set CURL_CA_BUNDLE=C:\path\to\mycompanyCA.pem | |
set PYTHONPATH=src | |
python -m unittest test\mytest.py |
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
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: ubuntu | |
labels: | |
app: ubuntu | |
spec: | |
containers: | |
- image: ubuntu | |
command: |
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
from zeep import Client | |
wsdl = 'http://www.dneonline.com/calculator.asmx?WSDL' | |
arg = {'intA':2, 'intB':3} | |
op = 'Add' | |
client = Client(wsdl) | |
res = client.service[op](**arg) | |
print(res) # 5 |
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 asyncio | |
# weak dependencies list as (dependency, dependent) | |
weak_deps = [(2,3),(4,1)] | |
# e.g. let's say activity 2 updates input of activity 3 as a weak dependency, etc... | |
async def gather_with_first_completed(awaitable_results): | |
# Create a list to store the completed results | |
completed_results = [] |
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 Control.Concurrent.STM | |
import Control.Monad | |
import Control.Concurrent | |
workerWaitForCondition :: TVar Bool -> IO () | |
workerWaitForCondition condition = atomically $ do | |
c <- readTVar condition | |
unless c retry | |
workerMakeConditionTrue :: TVar Bool -> IO () |
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
package io.github.nomisrev | |
import app.cash.sqldelight.driver.jdbc.asJdbcDriver | |
import arrow.continuations.SuspendApp | |
import arrow.continuations.ktor.server | |
import arrow.fx.coroutines.autoCloseable | |
import arrow.fx.coroutines.closeable | |
import arrow.fx.coroutines.resourceScope | |
import com.zaxxer.hikari.HikariConfig | |
import com.zaxxer.hikari.HikariDataSource |
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 dep "org.http4s::http4s-scalatags::0.25.2" | |
//> using dep "org.http4s::http4s-dsl::0.23.23" | |
//> using dep "org.http4s::http4s-ember-server::0.23.23" | |
//> using dep "org.tpolecat::skunk-core::0.6.0" | |
//> using dep "com.dimafeng::testcontainers-scala-postgresql::0.41.0" | |
//> using dep "com.outr::scribe-slf4j::3.12.2" | |
import skunk.*, codec.all.*, syntax.all.* | |
import cats.effect.* | |
import scalatags.Text.all.* |
NewerOlder