Skip to content

Instantly share code, notes, and snippets.

@helios2k6
helios2k6 / self-signed-certificate-with-custom-ca.md
Last active March 26, 2024 13:31 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl ecparam -genkey -name prime256v1 -noout -out <ROOT_CA_KEY>
@helios2k6
helios2k6 / stock_trading_calendar.json
Created November 5, 2021 16:25
United States Stock Market Ope and Close Hours from 2000-01-03 until 2029-12-24
This file has been truncated, but you can view the full file.
[
{
"date": "2000-01-03",
"open": "09:30",
"close": "16:00",
"session_open": "0700",
"session_close": "1900"
},
{
"date": "2000-01-04",
@helios2k6
helios2k6 / AnagramSingleWord.cs
Created June 10, 2019 23:56
Finding Substring Anagrams
using System;
using System.Collections.Generic;
using System.Linq;
public static class AnagramInSingleWord
{
private static void AddToSubstringDictionary(
string s, Tuple<int, int> startAndLength,
IDictionary<Tuple<int, int>, string> substrings
)
@helios2k6
helios2k6 / DFT.cs
Last active November 14, 2016 03:01
DFT Implementations, including FFT
private static Complex[] DFTDirectComputation(Complex[] input)
{
int N = input.Length;
Complex[] output = new Complex[input.Length];
for (int k = 0; k < input.Length; k++)
{
var sum = new Complex();
for (int n = 0; n < input.Length; n++)
{
sum += input[n] * WFunction(N, k * n);
let appendItem item sequence = seq { yield! sequence; yield item }
let testOverflow() =
seq { for i in 1..5000 do yield i }
|> Seq.fold (fun state item -> appendItem item state) Seq.empty
|> Seq.iter ignore