Skip to content

Instantly share code, notes, and snippets.

View RredCat's full-sized avatar

Taras Romanyk RredCat

View GitHub Profile
@RredCat
RredCat / contemplative-llms.txt
Created January 7, 2025 16:59 — forked from Maharshi-Pandya/contemplative-llms.txt
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@RredCat
RredCat / AWS SES Email Parser in Lambda
Created November 26, 2024 17:43 — forked from twratl/AWS SES Email Parser in Lambda
Sample Python Lambda code for parsing emails delivered to S3 buckets via SES and then Lambda invocation from SES - untested
# content provided as part of thread here: https://www.reddit.com/r/aws/comments/cffmxr/how_do_you_strip_the_attachments_from_aws_sessns/
from email.parser import BytesParser
from email import policy
import os
# event will be JSON from SES incoming email rule - NOT an S3 PUT event
def lambda_handler(event, context):
try:
ses_mail = event['Records'][0]['ses']['mail']
@RredCat
RredCat / Example.cs
Created July 22, 2019 16:17
Example for FA
[Authorize(AuthenticationSchemes = "api")]
@RredCat
RredCat / Startup.cs
Created July 22, 2019 16:15
Startup for FA
services.AddAuthentication(o => o.AddScheme("api", a => a.HandlerType = typeof(TokenHandler)));
@RredCat
RredCat / TokenHandler.cs
Created July 22, 2019 15:33
TokenHandler for FA blog.
internal class TokenHandler : AuthenticationHandler
{
private const ulong _REQUEST_MAX_AGE_IN_SECONDS = 300; //5 mins
private const string _AUTHENTICATION_SCHEME = "amx";
private static readonly DateTime _1970 = new DateTime(1970, 01, 01, 0, 0, 0, 0, DateTimeKind.Utc);
private static readonly Dictionary _AllowedApps = new Dictionary();
private readonly IMemoryCache _cache;
public TokenHandler(IMemoryCache memoryCache, IOptionsMonitor options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock)