Skip to content

Instantly share code, notes, and snippets.

View zachwill's full-sized avatar

Zach Williams zachwill

View GitHub Profile
@zachwill
zachwill / appcrush.rb
Created July 28, 2012 03:01
Extract images from iOS .ipa files
#!/usr/bin/ruby -rubygems
#
# Point appcrush at an .ipa file from the iTunes AppStore and it
# - expands the zip file
# - finds all the images
# - runs pngcrush with the revert-iphone-optimizations option on each image
#
# Requirements Xcode with iOS SDK 3.2 or higher
#
# Usage: appcrush '/Users/boctor/Music/iTunes/Mobile Applications/iBooks.ipa'
@zachwill
zachwill / 538_colors.py
Created October 10, 2015 21:20
A simple FiveThirtyEight palette for Seaborn plots.
"""
A simple FiveThirtyEight palette for Seaborn plots.
"""
import seaborn as sns
import matplotlib.pyplot as plt
five_thirty_eight = [
"#30a2da",
"#fc4f30",
@zachwill
zachwill / chatreadretrieveread.py
Created December 28, 2023 20:52 — forked from pamelafox/chatreadretrieveread.py
Chat approach with additional function call
import json
import logging
import re
from typing import Any, AsyncGenerator, Optional, Union
import aiohttp
import openai
from azure.search.documents.aio import SearchClient
from azure.search.documents.models import QueryType
@zachwill
zachwill / tldr.txt
Created November 30, 2023 15:13
Best TL;DR prompt
# Best TL;DR prompt I’ve come up with
---
Role: Readable 60-word Content Summarizer
Main Task:
1. Read and understand the given article.
2. Generate a single, dense and concise final summary, incorporating numerous specific entities relevant to the article. This summary should be 60 words and 4 sentences in length, while maintaining a Flesch-Kincaid Ease score of at least 60 to 70, ensuring it is neither too complex nor too simplistic.
@zachwill
zachwill / items.py
Last active September 18, 2023 09:28
An easier way to meld Peewee models and Scrapy items.
import copy
from scrapy import Item
class ModelItem(Item):
"""
Make Peewee models easily turn into Scrapy Items.
>>> from models import Player
>>> item = ModelItem(Player())
"""
/**
*Submitted for verification at Etherscan.io on 2021-04-16
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
pragma solidity ^0.8.0;
/**
* @title KingFrog contract
* @dev Extends ERC721Enumerable Non-Fungible Token Standard basic implementation
*/
/**
* SPDX-License-Identifier: UNLICENSED
*/
@zachwill
zachwill / utils.py
Created November 18, 2011 22:32
Flask JSONP decorator
"""
Taken from: https://gist.github.com/1094140
"""
from functools import wraps
from flask import request, current_app
def jsonp(func):
"""Wraps JSONified output for JSONP requests."""
@zachwill
zachwill / fantasy-week-2.ipynb
Created September 16, 2020 17:03
Fantasy Football with RotoGuru and CatBoost
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zachwill
zachwill / domain_sales.csv
Last active May 30, 2020 16:29
Domain Sales
We can't make this file beautiful and searchable because it's too large.
date,domain,price,venue,length,dot_com,hyphen,numbers
2020-05-30,sit.ai,12000,Sedo,3,0,0,0
2020-05-30,zionism-israel.com,7801,GoDaddy,14,1,1,0
2020-05-30,simplybetter.com,5500,DropCatch,12,1,0,0
2020-05-30,libation.com,3656,NameJet,8,1,0,0
2020-05-30,boots2business.org,3484,GoDaddy,14,0,0,1
2020-05-30,mountainescape.com,3127,GoDaddy,14,1,0,0
2020-05-30,cingulum.com,3000,BuyDomains,8,1,0,0
2020-05-30,temperaturematters.com,2900,BuyDomains,18,1,0,0
2020-05-30,landkind.com,2777,Sedo,8,1,0,0