Skip to content

Instantly share code, notes, and snippets.

View brandedoutcast's full-sized avatar
🔥

R2 brandedoutcast

🔥
View GitHub Profile
@brandedoutcast
brandedoutcast / effective-fsharp.md
Created December 24, 2023 16:13 — forked from swlaschin/effective-fsharp.md
Effective F#, tips and tricks

Architecture

  • Use Onion architecture

    • Dependencies go inwards. That is, the Core domain doesn't know about outside layers
  • Use pipeline model to implement workflows/use-cases/stories

    • Business logic makes decisions
    • IO does storage with minimal logic
    • Keep Business logic and IO separate
  • Keep IO at edges

@brandedoutcast
brandedoutcast / Proxy.cs
Last active January 10, 2019 10:45
Generic Service Util Client Proxy to consume WCF services
using System;
using System.ServiceModel;
public class Proxy<T>
{
public ChannelFactory<T> Factory { get; set; }
public Proxy()
{
Factory = new ChannelFactory<T>("endpoint");
@brandedoutcast
brandedoutcast / Pod Mem Usage.ps1
Last active December 6, 2018 08:59
Simplest way to debug why a pod got OOMKilled with exit code 137
kubectl exec name-of-the-pod -- dmesg > C:\Path\To\Dump\File.txt
@brandedoutcast
brandedoutcast / Decode Kubernetes Secrets.ps1
Created November 22, 2018 07:22
Decode kubectl secrets in PowerShell
kubectl get secrets -o json | ConvertFrom-Json | select -ExpandProperty items | ? data | select -ExpandProperty data | % { $_.PSObject.Properties | % { $_.Name + [System.Environment]::NewLine + [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($_.Value)) + [System.Environment]::NewLine + [System.Environment]::NewLine } }
@brandedoutcast
brandedoutcast / IgnoreSSLCertificate.cs
Created October 25, 2018 11:56
Ignore SSL certificate check in a WCF service for .NET Framework & dotnet core
// For dotnet core
// Put this inside the Proxy client constructor
this.ClientCredentials.ServiceCertificate.SslCertificateAuthentication = new System.ServiceModel.Security.X509ServiceCertificateAuthentication()
{
CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None,
RevocationMode = System.Security.Cryptography.X509Certificates.X509RevocationMode.NoCheck
};
// For .NET Framework
// Place this anywhere in the program so that it's run before initializing the Proxy client
sudo apt update
sudo apt upgrade
sudo apt install fish
chsh -s /usr/bin/fish
mkdir -p ~/.config/fish
echo "set -g -x fish_greeting ''" >> ~/.config/fish/config.fish
@brandedoutcast
brandedoutcast / pubsub.js
Created March 26, 2018 14:05
Pub Sub Pattern
class PubSub {
constructor() {
this.events = []
}
on(name, handler) {
this.events[name] = this.events[name] || []
this.events[name].push(handler)
}
@brandedoutcast
brandedoutcast / spam-domains
Last active July 1, 2023 02:28
Spam domains that plague my email
jmails.info
sacustomerdelight.co.in
extrobuzzapp.com
ixigo.info
offer4uhub.com
netecart.com
101coupon.in
freedealcode.in
bankmarket.in
hotoffers.co.in
@brandedoutcast
brandedoutcast / hostednetwork.bat
Created February 20, 2018 05:48
Setup, Start, Stop & Restart scripts for hosted network on Windows
REM Setup Hosted Network
netsh wlan stop hostednetwork
netsh wlan set hostednetwork mode=allow ssid=RidersHub key=GiveMeInternet
netsh wlan start hostednetwork
#pause
REM Start Hosted Network
netsh wlan start hostednetwork
REM Stop Hosted Network
@brandedoutcast
brandedoutcast / number.js
Created February 18, 2018 15:56
JavaScript number precision in math operations
Object.defineProperties(Number.prototype, {
add: {
value: function (num, digitPrecision = 2) {
return parseFloat((this + num).toFixed(digitPrecision))
}
},
sub: {
value: function (num, digitPrecision = 2) {
return parseFloat((this - num).toFixed(digitPrecision))
}