Skip to content

Instantly share code, notes, and snippets.

View ryankanno's full-sized avatar
🇯🇵
Deconstructing

Ryan Kanno ryankanno

🇯🇵
Deconstructing
View GitHub Profile
@harperreed
harperreed / chain_summarization.py
Created September 16, 2023 03:16
Chain of Density Summarization
# Import required packages
from dotenv import load_dotenv # For managing environment variables
from html2text import html2text # For HTML to markdown conversion
from readability import Document # For summarizing HTML content
from typing import List # For type hinting
import json # For JSON parsing
import logging # For logging errors
import openai # OpenAI GPT API
import os # For OS-level operations
import requests # For HTTP requests
@impredicative
impredicative / logger.py
Last active March 11, 2023 10:59
Python json logging using structlog and stdlib logging
"""
Usage example:
from logger import get_logger
log = get_logger()
log.info('my_event', my_key1='val 1', my_key2=5, my_key3=[1, 2, 3], my_key4={'a': 1, 'b': 2})
List of metadata keys in each log message:
event
_func
@ryansch
ryansch / README.md
Created July 23, 2016 22:24
neovim + yadr
@ryan0x44
ryan0x44 / Terraform-Blue-Green-AWS.md
Created November 19, 2015 21:57
Blue-Green AWS Auto Scaling Deployments with Terraform

A quick note on how I'm currently handling Blue/Green or A/B deployments with Terraform and AWS EC2 Auto Scaling.

In my particular use case, I want to be able to inspect an AMI deployment manually before disabling the previous deployment.

Hopefully someone finds this useful, and if you have and feedback please leave a comment or email me.

Overview

I build my AMI's using Packer and Ansible.

//await connection.OpenWithRetryAsync(retryPolicy).ConfigureAwait(false);
//var reader = await command.ExecuteReaderWithRetryAsync(retryPolicy).ConfigureAwait(false);
public static Task OpenWithRetryAsync(this SqlConnection connection,
RetryPolicy retryPolicy)
{
return retryPolicy.ExecuteAsync(connection.OpenAsync);
}

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@sjourdan
sjourdan / The Operations Report Card.md
Last active December 24, 2023 16:35
The Operations Report Card

The Operations Report Card

Source: http://www.opsreportcard.com/.

Public Facing Practices

  1. Are user requests tracked via a ticket system?
  2. Are "the 3 empowering policies" defined and published?
  3. Does the team record monthly metrics?
@staltz
staltz / introrx.md
Last active July 27, 2024 04:59
The introduction to Reactive Programming you've been missing
@JamesRandall
JamesRandall / BlobStorageMultipartStreamProvider.cs
Last active March 19, 2020 23:12
Azure Blob Container Web API Image Upload
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;