Scrapes data from https://www.myedenred.pt/ into a csv file
run with dotnet test
public class DataPipeline<T> | |
{ | |
private static ExecutionDataflowBlockOptions Options => new() { BoundedCapacity = 1 }; | |
private readonly IReceivableSourceBlock<T> sourceBlock; | |
public DataPipeline(IReceivableSourceBlock<T> sourceBlock) => this.sourceBlock = sourceBlock; | |
public Task Completion => sourceBlock.Completion; | |
public IAsyncEnumerable<T> ReceiveAllAsync(CancellationToken ct = default) => sourceBlock.ReceiveAllAsync(ct); | |
public DataPipeline<TOut> Activity<TOut>(Func<T, Task<TOut>> action) => Link(new TransformBlock<T, TOut>(action, Options)); |
using System.Threading; | |
using System.Threading.Channels; | |
using System.Threading.Tasks; | |
class Processor<T> where T : class | |
{ | |
private readonly Channel<T> _channel = Channel.CreateUnbounded<T>(); | |
private readonly Task processors; | |
public Processor(Func<T, Task> action, int numberOfConsumers = 4) |
set clipboard=unnamed "Use System clipboard | |
set autoindent "New lines inherit the indentation of previous lines | |
set expandtab "Convert tabs to spaces. | |
set smarttab "Insert 'tabstop' number of spaces when the 'tab' key is pressed. | |
set tabstop=4 "Indent using four spaces. | |
set shiftwidth=4 | |
set hlsearch "Enable search highlighting. | |
set incsearch "Incremental search that shows partial matches. | |
set smartcase "Automatically switch search to case-sensitive when search query contains an uppercase letter. |
function otp($SECRET="ABCDEFGHIJKLMNOP", $LENGTH=6, $WINDOW=30){ | |
$span = (New-TimeSpan -Start (Get-Date -Year 1970 -Month 1 -Day 1 -Hour 0 -Minute 0 -Second 0) -End (Get-Date).ToUniversalTime()).TotalSeconds | |
$unixTime = [Convert]::ToInt64([Math]::Floor($span/$WINDOW)) | |
$timeBytes = [BitConverter]::GetBytes($unixTime) | |
[array]::Reverse($timeBytes) | |
$enc = [System.Text.Encoding]::UTF8 | |
$hmac = New-Object -TypeName System.Security.Cryptography.HMACSHA1 | |
$hmac.key = Convert-Base32ToBytes($SECRET.ToUpper()) | |
$randHash = $hmac.ComputeHash($timeBytes) |
public class DesignTimeFactory : IDesignTimeDbContextFactory<MyDbContext> | |
{ | |
public MarketDataServiceDbContext CreateDbContext(string[] args) | |
=> new MyDbContext(new DbContextOptionsBuilder<MyDbContext>().UseSqlServer(args[0]).Options); | |
} |
Scrapes data from https://www.myedenred.pt/ into a csv file
run with dotnet test
$certPath = ".\seq\Certificates\443.pem" | |
$needNewCert = if (Test-Path $certPath) { | |
$cert=New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($certPath) | |
#should return true if cert is expired | |
$cert.NotAfter -lt (Get-Date) | |
} else { | |
$true | |
} | |
# download certificates if needed | |
if ($needNewCert) { |
Has anyone provided a proof of God’s inexistence? Not even close. Has quantum cosmology explained the emergence of the universe or why it is here? Not even close. Have the sciences explained why our universe seems to be fine-tuned to allow for the existence of life? Not even close. Are physicists and biologists willing to believe in anything so long as it is not religious thought? Close enough. Has rationalism in moral thought provided us with an understanding of what is good, what is right, and what is moral? Not close enough. Has secularism in the terrible twentieth century been a force for good? Not even close to being close. Is there a narrow and oppressive orthodoxy of thought and opinion within the sciences? Close enough. Does anything in the sciences or in their philosophy justify the claim that religious belief is irrational? Not even ballpark. Is scientific atheism a frivolous exercise in intellectual contempt? Dead on. David Berlinsky from http://www.davidberlinski.org/devils-delusion/about.php
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions | |
cinst librewolf # Vimium, Bitwarden | |
cinst vlc | |
cinst zoom | |
cinst treesizefree | |
cinst lockhunter | |
cinst obs-studio, obs-virtualcam | |
cinst musescore | |
cinst sumatrapdf |