Skip to content

Instantly share code, notes, and snippets.

@philiplaureano
philiplaureano / putin_feb_2023_speech.md
Created February 21, 2023 22:12
A ChatGPT-generated summary of Putin's "State of the Nation" speech that was given on 21 Feb 2023

Summary of Vladimir Putin's 2022 State of the Nation Address

In his annual State of the Nation address, Russian President Vladimir Putin addressed a range of topics, including the country's response to the COVID-19 pandemic, economic recovery, social issues, foreign policy, and military power. The following is a breakdown of each topic and some sub-bullet points of his speech:

Foreign Policy

  • Putin discussed the need to protect Russia's sovereignty and security in the face of foreign aggression and pressure. He criticized Western nations for their attempts to weaken Russia through sanctions, propaganda, and military pressure.
  • Putin emphasized Russia's commitment to peaceful cooperation with other nations, including its efforts to combat terrorism, promote disarmament, and address climate change.
  • In regards to Ukraine, Putin accused Western nations of interfering in the country's internal affairs and supporting anti-Russian policies. He called for an end to the conflict in eastern Ukraine and critic
@philiplaureano
philiplaureano / IFetchInstance.cs
Created June 16, 2019 12:06
The most minimalistic actor system interface for fetching/creating actors
public interface IFetchInstance<TKey, TItem>
{
Option<TItem> Fetch(TKey key);
}
open System
open System.Threading.Tasks
open Proto
open Proto.Mailbox
type Actor with
static member SpawnFromFunc handler =
Actor.FromFunc(fun c-> handler(c)) |> Actor.Spawn
[<EntryPoint>]
@philiplaureano
philiplaureano / ReceiveActor.cs
Created July 1, 2017 11:09
A base class for Proto.Actor that makes it easier to migrate actors between Akka.NET and Proto.Actor
public abstract class ReceiveActor : IActor
{
private List<(Func<object, bool>, Action<object>)> _handlers = new List<(Func<object, bool>, Action<object>)>();
public async Task ReceiveAsync(IContext context)
{
if (context.Message is Restarting)
PreRestart(null, context.Message);
if (context.Message is Started)
PreStart();
@philiplaureano
philiplaureano / Reflection.cs
Created May 22, 2017 23:59 — forked from TryJSIL/Reflection.cs
Reflection in JSIL
using System;
using System.Reflection;
using System.Collections.Generic;
public static class Program {
public static void Main (string[] args) {
Common.Util.ListMembers<MethodInfo>(
typeof(T),
BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.Public
);
@philiplaureano
philiplaureano / DeflectorInstanceMethodInterceptionDemo.cs
Last active March 28, 2016 09:15
An example of how easy it is to intercept instance method calls with Deflector.NET
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SampleLibrary;
namespace Deflector.Demos
{
class Program
Yep. If you want app-wide AOP, here's the interface that you need to implement that does the method replacement:
public interface IMethodCallProvider
{
void AddMethodCalls(object target, MethodBase hostMethod, IEnumerable<MethodBase> interceptedMethods,
IMethodCallMap methodCallMap, StackTrace stackTrace);
}
Most of the parameters on the AddMethodCalls method are self explanatory, except for the methodCallMap parameter, which looks like this:
@philiplaureano
philiplaureano / InstantiatingGenericMethodsWithFunctify
Last active August 29, 2015 14:04
An example of how to use Functify to call and instantiate a generic method at runtime.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FunctifyBench
{
using System.Reflection;
@philiplaureano
philiplaureano / gist:6bcc6e81fd00b49e4aae
Created July 29, 2014 03:14
An example of how to implement partially-applied generic factories with Functify so that you can create functions that create generic type factory methods with only some of the type parameters left open
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FunctifyBench
{
using Functify;
@philiplaureano
philiplaureano / gist:f481e6b0ec68173d04d9
Last active August 29, 2015 14:04
An example of how to use LinFu's new ability to append extension methods to an existing dynamic type and treat it as if it were an instance method
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using LinFu.Finders;
using LinFu.Finders.Interfaces;
using LinFu.Reflection;
using CLRDynamicObject = System.Dynamic.DynamicObject;