Skip to content

Instantly share code, notes, and snippets.

View tcombs's full-sized avatar
🦄

Tyler Combs tcombs

🦄
View GitHub Profile
@tcombs
tcombs / HttpCodes.java
Last active January 17, 2018 21:59
A Collection of HTTP Status codes in java. An overview of the uses of each status code can be found here: https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
public class HttpCode {
// Informational 1xx
public static final int CONTINUE = 100;
public static final int SWITCHING_PROTOCOLS = 101;
// Successful 2xx
public static final int OK = 200;
public static final int CREATED = 201;
public static final int ACCEPTED = 202;
@tcombs
tcombs / ObjectMapper.java
Created March 31, 2016 15:03
Use Gson to map from one object to another.
import com.google.gson.GsonBuilder;
import com.google.gson.Gson;
public class ObjectMapper {
public static <T> T map(Object object, Class<T> clazz) {
Gson gson = new GsonBuilder().create();
String json = gson.toJson(object);
return gson.fromJson(json, clazz);
}
}
import os
import logging
import pickle
from typing import List, TypedDict, Annotated, Optional
from pathlib import Path
# PDF processing
import PyPDF2
from io import BytesIO