Skip to content

Instantly share code, notes, and snippets.

View eaba's full-sized avatar

Ebere Abanonu eaba

View GitHub Profile
@to11mtm
to11mtm / BatchingStreamBuilder.CS
Last active June 25, 2021 02:32
A Helper to create a Batched stream based on a producer function
using System;
using System.Threading.Tasks;
using Akka.Actor;
using Akka.Pattern;
using Akka.Streams.Dsl;
using LanguageExt;
namespace Akka.Persistence.Sql.Linq2Db.Journal.DAO
{
public class BatchFlowControl
@badamczewski
badamczewski / BitSet.cs
Created December 1, 2020 13:08
BloomFilter Source Code
using System;
using System.Collections.Generic;
using System.Text;
namespace ProbabilisticDataStructures.DataStructures
{
public class BitSet
{
private ulong[] bitset;
public int Size { get; private set; }
@PureWeen
PureWeen / FlyoutMenuTemplates.md
Created November 23, 2019 03:44
Flyout and MenuTemplates
<?xml version="1.0" encoding="UTF-8"?>
<Shell xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:d="http://xamarin.com/schemas/2014/forms/design" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:local="clr-namespace:ShellFlyouts.Views" Title="ShellFlyouts" x:Class="ShellFlyouts.AppShell"
    Shell.ItemTemplate="{StaticResource FlyoutTemplates}"
    Shell.MenuItemTemplate="{StaticResource FlyoutTemplates}"
      >
    <!-- 
        Styles and Resources 
    -->
    <Shell.Resources>
@Horusiath
Horusiath / Program.cs
Last active November 24, 2020 05:45
An interfaced generic-aware Akka.NET actor implementation
using System;
using System.Threading.Tasks;
using Akka.Actor;
using Akka.Configuration;
namespace AkkaDemos
{
public interface IGreeter
{
Task<string> Greet(IGreeter who);
@jb-alvarado
jb-alvarado / hls.conf
Last active January 23, 2024 20:58
srs rtmp server with hls multiple bitrates
listen 1935;
max_connections 20;
daemon on;
pid /usr/local/srs/objs/srs.pid;
srs_log_tank file; # console;
srs_log_file /var/log/srs.log;
ff_log_dir /dev/null;
# can be: verbose, info, trace, warn, error
srs_log_level warn;
@Horusiath
Horusiath / Demo.cs
Last active November 24, 2020 06:04
Custom Akka.NET Streams graph stage for prefetching elements, when the buffer comes close to the empty
using Akka.Streams;
using Akka.Streams.Stage;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace Demo
{
sealed class PreFetch<T> : GraphStage<SourceShape<T>>
@ian-whitestone
ian-whitestone / notes.md
Last active March 1, 2023 01:45
Best practices for presto sql

Presto Specific

  • Don’t SELECT *, Specify explicit column names (columnar store)
  • Avoid large JOINs (filter each table first)
    • In PRESTO tables are joined in the order they are listed!!
    • Join small tables earlier in the plan and leave larger fact tables to the end
    • Avoid cross joins or 1 to many joins as these can degrade performance
  • Order by and group by take time
    • only use order by in subqueries if it is really necessary
  • When using GROUP BY, order the columns by the highest cardinality (that is, most number of unique values) to the lowest.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<RootNamespace></RootNamespace>
<IsPackable>False</IsPackable>
<NoWarn>CS0649;CS0169</NoWarn>
@OpBug
OpBug / HashPuzzle.cs
Last active August 28, 2020 05:01
C# proof-of-work implementation inspired by Hashcash to deter denial of service attacks and other service abuses such as spam.
using System;
using System.Security.Cryptography;
/// <summary>
/// Computes and verifies proof-of-work challenges inspired by Hashcash to deter denial of service attacks and other service abuses such as spam.
/// </summary>
public sealed class HashPuzzle
{
#region " Properties "
@yutopio
yutopio / cert.cs
Created February 20, 2017 12:14
Certificate generation with BouncyCastle C#
using Org.BouncyCastle.Asn1.Pkcs;
using Org.BouncyCastle.Asn1.Sec;
using Org.BouncyCastle.Asn1.X509;
using Org.BouncyCastle.Asn1.X9;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Generators;
using Org.BouncyCastle.Crypto.Operators;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Math;
using Org.BouncyCastle.Security;