Skip to content

Instantly share code, notes, and snippets.

View ewinnington's full-sized avatar

Eric Winnington ewinnington

View GitHub Profile
@ewinnington
ewinnington / extract-md.js
Last active May 12, 2025 21:06
bookmarklet to extract chatgpt bubble to markdown on clipboard
(function () {
// Minimal inline HTML-to-Markdown converter.
function htmlToMarkdown(el) {
// Recursive function to process nodes.
function processNode(node, parentTag) {
if (node.nodeType === Node.TEXT_NODE) {
return node.textContent;
}
if (node.nodeType !== Node.ELEMENT_NODE) {
return "";
@ewinnington
ewinnington / Cocaine-vs-Alcohol.md
Created February 7, 2025 14:27
Cocaine vs. Alcohol: Effects, Addiction, and Public Health Impact

Cocaine vs. Alcohol: Effects, Addiction, and Public Health Impact

Introduction: A recent claim by Colombia’s President Gustavo Petro that “cocaine is no worse than whiskey”reuters.com has ignited debate about the relative harms of cocaine and alcohol. Both substances have significant effects on the human body and mind, but they differ in legal status and public health impact. This analysis examines the physical and psychological effects of cocaine and alcohol, their addiction risks, and compares their harm on individual and societal levels. It also reviews contrarian viewpoints (including Petro’s) that argue cocaine’s harm is comparable to alcohol, and discusses how international drug policies treat these substances.

Physical Effects of Cocaine on the Body

import os
from openai import OpenAI
token = os.getenv('GH_TOKEN')
endpoint="https://models.inference.ai.azure.com"
client = OpenAI(
base_url=endpoint,
api_key=token,
)
@ewinnington
ewinnington / bash_ci.sh
Created July 21, 2023 15:15
bash_ci.sh
#!/bin/bash
# Docker image (replace "<YOUR_IMAGE_NAME>" with your docker image name)
docker_image="<YOUR_IMAGE_NAME>:latest"
# Push the Docker image to a container registry (replace "<YOUR_REGISTRY_URL>" with your registry URL)
registry="<YOUR_REGISTRY_URL>.azurecr.io"
# Function to check if a command exists
command_exists() {
Orca - https://arxiv.org/pdf/2306.02707.pdf
Textbooks Are All You Need - https://arxiv.org/pdf/2306.11644.pdf
Augmenting Language Models with Long-Term Memory - https://arxiv.org/pdf/2306.07174.pdf
import redis
import datetime
import time
r = redis.StrictRedis(host='localhost', port=6379, db=0, decode_responses=True)
r.set('key1', 'Hello World')
print('key1 ' + r.get('key1'))
# Create a user object with id, name, age, email and username

https://infrastructure.aws/

Regions:

  • Proximity to users
  • Compliance
  • some services are not available in some regions
  • Regions have a different cost footprint

S3

  • gotchas of hosting on S3
//#r "nuget:Utf8Json"
using Utf8Json;
using System.Runtime.Serialization;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System;
namespace Console1
{
@ewinnington
ewinnington / PartsUnlimited.md
Last active June 15, 2019 14:40
DevOps 2019 - PostMortems

Azure devops day - Parts unlimited

Denial of service

Website is down, too many connections

Quick fix

AppServices -> Settings -> Adding scale out +1

Retrospective / Postmortem

@ewinnington
ewinnington / SingleFileCSharpTypeSystemParserInterpreter.cs
Last active August 11, 2017 22:02
Copied the code from Using C#'s Type System Effectively - Benjamin Hodgson ( https://www.youtube.com/watch?v=lsUgwfK9XIM&t=3122s )
using System;
using System.Collections.Generic;
using System.Linq;
namespace Eric.Exploration.InterpreterParser.StackoverflowTags
{
public class Job
{
public int Id { get; }
public string[] Tags { get; }